View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Column index name

You generally don't need to do this in a macro. instead of

Sheets("Sheet1").Range(Chr(64 + n) & "2").Formula = "=SUM(A1:B1)"

for instance, use

Sheets("Sheet1").Cells(2, n).Formula = "=SUM(A1:B1)"

or, if your range is in the formula:

Range("B1").Formula = _
"=SUM(" & Cells(2, n).Resize(10, 1).Address(0, 0) & ")"


In article ,
"John" wrote:

I got a question that maybe a minor one to everyone. but anyway, if I know
the column number, how do I know what "alphabeth letter" refer to it? E.g.
I know the value c = 5 as referring column 5, but is there a way to return
the column letter "E" instead of 5? Please help since will need to use it
for setting formula inside macro. Many many thanks.