PC Review


Reply
Thread Tools Rate Thread

Column label based on column index

 
 
igorek
Guest
Posts: n/a
 
      14th Dec 2007
Is there a way to get a column label (A, B, ...AA, AB ) based on column
number. Lets say i have a column number 27 thus i want to see AA.

thanks
Ig


 
Reply With Quote
 
 
 
 
Niek Otten
Guest
Posts: n/a
 
      14th Dec 2007
=LEFT(ADDRESS(1,A1,4),LEN(ADDRESS(1,A1,4))-1)

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"igorek" <(E-Mail Removed)> wrote in message news:A2A48FA4-B4AF-4876-AC67-(E-Mail Removed)...
| Is there a way to get a column label (A, B, ...AA, AB ) based on column
| number. Lets say i have a column number 27 thus i want to see AA.
|
| thanks
| Ig
|
|


 
Reply With Quote
 
Leith Ross
Guest
Posts: n/a
 
      15th Dec 2007
On Dec 14, 10:51 am, igorek <igo...@discussions.microsoft.com> wrote:
> Is there a way to get a column label (A, B, ...AA, AB ) based on column
> number. Lets say i have a column number 27 thus i want to see AA.
>
> thanks
> Ig


Hello lg,

Here is function that takes the column letter and returns the column
number.

Function ColNumber(Column_Letter As String) As Long

ColNumber = ActiveSheet.Cells(1, Column_Letter).Column

End Function


Example:
N = ColNumber("AA")

Sincerely,
Leith Ross
 
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
Query based on Column Index Matt Cromer Microsoft Access Queries 9 25th Sep 2008 09:29 PM
Search for a column based on the column header and then past data from it to another column in another workbook minkokiss Microsoft Excel Programming 2 5th Apr 2007 01:12 AM
Based on a condition in one column, search for a year in another column, and display data from another column in the same row >> look MPSingley@midamerican.com Microsoft Excel Programming 2 30th Dec 2006 06:23 PM
Based on a condition in one column, search for a year in another column, and display data from another column in the same row >> look MPSingley@midamerican.com Microsoft Excel Misc 0 27th Dec 2006 04:31 PM
Select a column based on a index =?Utf-8?B?Vkg=?= Microsoft Excel Programming 5 6th Mar 2006 09:40 AM


Features
 

Advertising
 

Newsgroups
 


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