Click here to Skip to main content
15,900,907 members

Comments by Member 13861149 (Top 9 by date)

Member 13861149 14-Jun-18 5:07am View    
Thank you
Member 13861149 14-Jun-18 4:59am View    
Thank you. Its working now without any errors...
Member 13861149 13-Jun-18 23:25pm View    
The new code of ConvertTo() is not returning the exact value. rng currently holds only the range like 6:10 but not taking the characters such as D,E,F etc.(i.e, Previously the value in range was D6:D10,E6:E10 etc but now its 6:10). So the macro entirely goes wrong.
Member 13861149 13-Jun-18 23:10pm View    
Function ConvertToLetter(iCol As Integer) As String
'https://support.microsoft.com/en-gb/help/833402/how-to-convert-excel-column-numbers-into-alphabetical-characters
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
Member 13861149 13-Jun-18 5:19am View    
I checked the values each variable is holding. The code works smoothly till column AZ. But when col=53 (i.e BA), rng should be BA6:BA7 but i am getting the value "A[6:A[7" which follows the run time error