Jaymond Flurrie
Well-known Member
- Joined
- Sep 22, 2008
- Messages
- 919
- Office Version
- 365
- Platform
- Windows
So plain and simply, I ask a user that what is the column. The user might answer A or IJ or XEE.
Is there a simple way to translate this to a number? Like A = 1, B = 2, XFD = 16384 and so on.
I would need the number in my VBA code to do for example like:
and obviously I can't count "A+1 = 2". The row part works just fine.
Edit. Actually, it doesn't make a lot of sense to have more than 26 (even that's way too many) headercolumns, so I think for this purpose
does the trick.
Is there a simple way to translate this to a number? Like A = 1, B = 2, XFD = 16384 and so on.
I would need the number in my VBA code to do for example like:
VBA Code:
Dim lastheaderrow As Integer
lastheaderrow = controlsheet.Range("LastHeaderRow").Value
Dim lastheadercolumn As Integer
lastheadercolumn = 1
Dim firstdatarangecell As Range
Set firstdatarangecell = Cells(lastheaderrow + 1, lastheadercolumn + 1)
Edit. Actually, it doesn't make a lot of sense to have more than 26 (even that's way too many) headercolumns, so I think for this purpose
VBA Code:
Dim lastheadercolumnletter As String
lastheadercolumnletter = controlsheet.Range("LastHeaderColumn").Value
Dim lastheadercolumn As Integer
lastheadercolumn = Asc(lastheadercolumnletter) - 64
Last edited: