MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Get the column address in alphabets - i.e. A, B, C .. etc

Posted by Raj Nair on October 29, 2001 2:37 AM

I am trying a macro which automatically populates formulae for cells like (=A1*B2), say. Of this, B is to be detemined through a macro.

Now, within a Macro, How do I get this "B". If I try activecell.column, it gives 2. I get column in activecell.address, but I have to strip off rowd details. Is there any other way to get the alphabetical address of a column from within VBA ?


Posted by Juan Pablo on October 29, 2001 5:06 AM

One option is using R1C1 formulas, for example if your activecell is D1 you can use this formula to calculate =A1*B2

ActiveCell.FormulaR1C1 = "=RC[-3]*R[1]C[-2]"

Does this help ?

Juan Pablo