close

I have a column of numbers, 4 numbers to a cell. I want to add an X at the
end of numbers in various cells. I double click on the cell, the curser
moves to the end of the number and I add an X. I move to the nexrt cell down
and repeat. When I do this with a macro, instead of adding just the X, it
writes in the number from the first cell and the X. How do I do make the
macro only add a X to the current number?


For Each cell in selection
cell.value = cell.Value amp; quot;Xquot;
Next cell

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

quot;CCB AAquot; gt; wrote in message
...
gt; I have a column of numbers, 4 numbers to a cell. I want to add an X at
the
gt; end of numbers in various cells. I double click on the cell, the curser
gt; moves to the end of the number and I add an X. I move to the nexrt cell
down
gt; and repeat. When I do this with a macro, instead of adding just the X, it
gt; writes in the number from the first cell and the X. How do I do make the
gt; macro only add a X to the current number?
I don't think you can do that with the recorder. Unless you have a way to
identify all of the numbers ahead of time, you can use the macro below. Just
click on the cell you want to add an X to and run the macro.
You will have to copy and past the code into your module.

Sub EndWithX()
ActiveCell.Value = ActiveCell.Value amp; quot;Xquot;
End Sub

--
tjquot;CCB AAquot; wrote:

gt; I have a column of numbers, 4 numbers to a cell. I want to add an X at the
gt; end of numbers in various cells. I double click on the cell, the curser
gt; moves to the end of the number and I add an X. I move to the nexrt cell down
gt; and repeat. When I do this with a macro, instead of adding just the X, it
gt; writes in the number from the first cell and the X. How do I do make the
gt; macro only add a X to the current number?

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()