Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I turn excel columns from column number to column letter? | Setting up and Configuration of Excel | |||
How to replace column letter in refferences with a function using the old column letter? | Links and Linking in Excel | |||
How to replace column letter in refferences with a function using the old column letter? | Excel Worksheet Functions | |||
Get Column Letter from Column Number | Excel Worksheet Functions | |||
column header changed from letter to number, how return to letter | Excel Discussion (Misc queries) |