Column label based on column index

  • Thread starter Thread starter igorek
  • Start date Start date
I

igorek

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
 
=LEFT(ADDRESS(1,A1,4),LEN(ADDRESS(1,A1,4))-1)

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| 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
|
|
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top