Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I turn excel columns from column number to column letter? column Setting up and Configuration of Excel 1 April 29th 08 10:15 AM
How to replace column letter in refferences with a function using the old column letter? Dmitry Kopnichev Links and Linking in Excel 6 October 13th 05 09:09 AM
How to replace column letter in refferences with a function using the old column letter? Dmitry Kopnichev Excel Worksheet Functions 6 October 13th 05 09:09 AM
Get Column Letter from Column Number Gary Brown Excel Worksheet Functions 7 June 11th 05 02:08 AM
column header changed from letter to number, how return to letter Ron Excel Discussion (Misc queries) 2 May 9th 05 08:34 PM


All times are GMT +1. The time now is 03:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"