How to prepend ctr in a macro?

C

Chuck Roberts

I have Excel 2000 on Win 2000. I would like to make a macro where I put a zero
character (not number) at the beginning of the current cell, then move the
cursor down. I have tried reading the help on the Cells property but I didn't
see anything that could help me. All examples were for absolute cells, I need
to process the current cell.

Anyone know how to do this?
Thank you.
 
J

JulieD

Hi Chuck

Do Until ActiveCell.Value = ""
ActiveCell.Value = "0" & ActiveCell.Value
ActiveCell.Offset(1, 0).Range("A1").Select
Loop

is this what you're after?

Cheers
JulieD
 
E

Earl Kiosterud

Chuck,

I'm not sure if you wanted to insert the zero in front of existing stuff in
the cell, as in Julie's solution, or just put a zero there. If the latter:

ActiveCell = "'0"
ActiveCell.Offset(1,0).Select

The apostrophe keeps text "0" from becoming the number 0 when put in the
cell. Not necessary if the cell is formatted for text.
 
Top