Answers for "excel vba convert column name to number"

VBA
31

excel vba function to convert column number to letter

Function ColName(n)
    ColName = Split(Cells(, n).Address, "$")(1)
End Function
Posted by: Guest on March-30-2020
0

excel vba Column Name from Column Number

' Column name to column number
ColName = "A"
Debug.Print Range(ColName & 1).Column    ' 1
' Column number to column name
ColNb = 1
Debug.Print Split(Cells(, ColNb).Address, "$")(1)
Posted by: Guest on February-08-2021

Code answers related to "VBA"

Browse Popular Code Answers by Language