G Guest Jun 8, 2007 #1 I have the column letter of a cell and I need the column number. I know this must be simple but I cannot figure out how to do it.
I have the column letter of a cell and I need the column number. I know this must be simple but I cannot figure out how to do it.
J Jon Peltier Jun 8, 2007 #2 In a cell: =COLUMN(A1) In VBA: iColNum = Worksheets("Sheet1").Range("A1").Column - Jon
G Guest Jun 8, 2007 #4 Robert, One way is to use the Column property of the Range object. For example, to determine the column number of the column "AY", Sub test() Dim iColumn As Integer iColumn = Range("AY1").Column End Sub
Robert, One way is to use the Column property of the Range object. For example, to determine the column number of the column "AY", Sub test() Dim iColumn As Integer iColumn = Range("AY1").Column End Sub
G Guest Jun 8, 2007 #5 Function ColLetterToNumber(Letter As String) As Long ColLetterToNumber = Columns(Letter).Column End Function
Function ColLetterToNumber(Letter As String) As Long ColLetterToNumber = Columns(Letter).Column End Function