GreenyMcDuff
Active Member
- Joined
- Sep 20, 2010
- Messages
- 313
Hi guys,
I found this Function to convert a column letter to number:
I am trying to then use the value in a range:
I don't think I have implemented the function properly as the code is not working
I would be most grateful for your help
Thanks
Chris
I found this Function to convert a column letter to number:
Code:
Function ConvertToLetter(iCol As Integer) As String
Dim iAlpha As Integer
Dim iRemainder As Integer
iAlpha = Int(iCol / 27)
iRemainder = iCol - (iAlpha * 26)
If iAlpha > 0 Then
ConvertToLetter = Chr(iAlpha + 64)
End If
If iRemainder > 0 Then
ConvertToLetter = ConvertToLetter & Chr(iRemainder + 64)
End If
End Function
I am trying to then use the value in a range:
Code:
With ActiveSheet
.Range("A1:" & ConvertToLetter & LastRow).Select
End With
I don't think I have implemented the function properly as the code is not working
I would be most grateful for your help
Thanks
Chris