Hi!
i got an vba code from a excel and it calculate out the column number and change it to column name.
but it just 2 chars. in excel we got column name like 3 chars.
example 1 char is only A. 2 char AA and 3 is AAA
i wonder some one can help me with the third char?
here's the formula
and here is the vba code
i need it in formula and code
any help is appreciated
i got an vba code from a excel and it calculate out the column number and change it to column name.
but it just 2 chars. in excel we got column name like 3 chars.
example 1 char is only A. 2 char AA and 3 is AAA
i wonder some one can help me with the third char?
here's the formula
Code:
A = =CHAR(COLUMN() + 64)
AA = =IF(COLUMN()>26;CHAR(ROUNDDOWN((COLUMN()-1)/26;0)+64)&CHAR(MOD((COLUMN()-1);26)+65);CHAR(COLUMN()+64))
AAA = ????
and here is the vba code
Code:
If iCol <= 26 Then
sColumn = Chr$(64 + iCol)
ElseIf iCol <= 27*26 Then
sColumn = Chr$((iCol - 1) \ 26 + 64) & Chr$((iCol - 1) Mod 26 + 65)
Else
sColumn = ???
End If
i need it in formula and code
any help is appreciated