![]() |
Column Number from Column Letter
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. -- Robert Hill |
Column Number from Column Letter
In a cell:
=COLUMN(A1) In VBA: iColNum = Worksheets("Sheet1").Range("A1").Column - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Robert" wrote in message ... 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. -- Robert Hill |
Column Number from Column Letter
Try:-
=COLUMN(E1) Would return 5. Mike "Robert" wrote: 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. -- Robert Hill |
Column Number from Column Letter
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 -- Hope that helps. Vergel Adriano "Robert" wrote: 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. -- Robert Hill |
Column Number from Column Letter
Function ColLetterToNumber(Letter As String) As Long
ColLetterToNumber = Columns(Letter).Column End Function "Robert" wrote: 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. -- Robert Hill |
Column Number from Column Letter
msgbox activesheet.cells(1,YourColumnLetterHere).column
Robert wrote: 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. -- Robert Hill -- Dave Peterson |
All times are GMT +1. The time now is 03:28 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com