Bob Phillips followup question on text macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Bob,
You gave me this wonderful macro last week, which has helped our group more
than you can know. I am wondering if there is any way to make this macro
relative, so that I dont have to go into the macro manually and change the
column reference when my data is in a different column than A. I'd like to
be able to click at the top of any column and have the macro run down that
current column

iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = 1 To iLastRow
Cells(i,"A").Value = "'0" & Cells(i,"A").VAlue
Next i

Thanks for your help
 
That's good to hear it is being so useful.

To answer your question, this should work on any cell in the column, not
just the top cell

iLastRow = Cells(Rows.Count,Activecell.Column).End(xlUp).Row
For i = 1 To iLastRow
Cells(i,"A").Value = "'0" & Cells(i,Activecell.Column).VAlue
Next i
 

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

Similar Threads


Back
Top