excel vba column number to cells address code example
Example 1: excel vba function to convert column number to letter
Function ColName(n)
ColName = Split(Cells(, n).Address, "$")(1)
End Function
Example 2: excel vba convert cells address
' From Cells(1,1) to "A1"
MsgBox Cells(1, 1).Address(RowAbsolute:=False, ColumnAbsolute:=False)
' From "A1" to Cells(1,1)
MsgBox Range("A1").Row & ", " & Range("A1").Column