spacebouncer
Board Regular
- Joined
- Feb 7, 2014
- Messages
- 109
Hi, is there an easy way to return the letter of a column, rather than its number? Thanks
Function columnletter(colnumber As Integer) As String
If colnumber <= 26 Then
columnletter = Chr(((colnumber + 1) Mod 26) + 63)
End If
If colnumber > 26 And colnumber <= 26 * 26 Then
columnletter = Chr((Int(colnumber / 26) + 64))
columnletter = columnletter & Chr(((colnumber + 1) Mod 26) + 63)
End If
End Function
Function GCL(MyRange As Range) As String
GCL = Split(MyRange.Address, "$")(1)
End Function