Odd behavior when approaching ZZZ

PKiss

New Member
Joined
Sep 22, 2011
Messages
34
I am confused as to why vba excel, after accepting to dive into the three letter range in both functions, decides not to work when approaching ZZZ.
Code:
Function ColumnLetterToNumber(Letters As String) As Long
    ColumnLetterToNumber = Range(Letters & "1").Column
End Function

Function ColumnLetterToNumber1(Letters As String) As Long
    ColumnLetterToNumber1 = ThisWorkbook.Worksheets(1).Columns(Letters).Column
End Function
Functions are suppose to convert Column letter to number equivalent.
Any ideas?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
The last column in Excel 2007+ is XFD (16,384). In nearlier versions it is IV (256).
 
Upvote 0
Both these functions refer to actual ranges on a sheet. If the range doesn't/can't exist then there will be an error. The highest column letters in xl 2010 is XFD.
 
Upvote 0

Forum statistics

Threads
1,226,588
Messages
6,191,887
Members
453,684
Latest member
Gretchenhines

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top