How to prepend ctr in a macro?

  • Thread starter Thread starter Chuck Roberts
  • Start date Start date
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.
 
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top