PC Review


Reply
Thread Tools Rate Thread

Column Number from Column Letter

 
 
=?Utf-8?B?Um9iZXJ0?=
Guest
Posts: n/a
 
      8th Jun 2007
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

 
Reply With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      8th Jun 2007
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" <(E-Mail Removed)> wrote in message
news:AA76A7FE-922E-4A11-A69B-(E-Mail Removed)...
>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
>



 
Reply With Quote
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      8th Jun 2007
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
>

 
Reply With Quote
 
=?Utf-8?B?VmVyZ2VsIEFkcmlhbm8=?=
Guest
Posts: n/a
 
      8th Jun 2007
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
>

 
Reply With Quote
 
=?Utf-8?B?dmJhcHJv?=
Guest
Posts: n/a
 
      8th Jun 2007
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
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      8th Jun 2007
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use column number in a range instead of column letter Greg Snidow Microsoft Excel Programming 2 16th Sep 2009 04:26 AM
Convert Column number to a letter? e.g. Column 203 = GU M Skabialka Microsoft Excel Discussion 11 29th Jul 2009 05:12 PM
How do I turn excel columns from column number to column letter? column Microsoft Excel Setup 1 29th Apr 2008 10:15 AM
From VBA: How to select a column by column number instead of letter? (Pete Cresswell) Microsoft Excel Discussion 2 5th Feb 2005 02:40 AM
From VBA: How to select a column by column number instead of letter? (Pete Cresswell) Microsoft Excel Discussion 3 4th Feb 2005 09:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:42 AM.