+ Reply to Thread
Results 1 to 6 of 6

How to go from column-number to column-letter?

  1. #1
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    How to go from column-number to column-letter?

    Question about converting from column number to column letter:

    I have a column number captured, k from:

    Please Login or Register  to view this content.
    And later in my routine I want to enter the Letter for k....

    For example, if k represents column#3 i would like to get the letter C...

    Seems like there should be a canned method for this, is there?
    Last edited by GeneralDisarray; 10-13-2011 at 11:24 PM.
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  2. #2
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Question about converting from column number to column letter:

    Ok, this is exactly what I'm doing for the time being:

    Please Login or Register  to view this content.
    I'm having to carry the letter around in another variable, can i get away without that?

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Question about converting from column number to column letter:

    Hi GeneralDisarray

    Here's a Function that does just that
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: How to go from column-number to column-letter?

    :D thank you sir, just what the doctor ordered

  5. #5
    Registered User
    Join Date
    07-21-2011
    Location
    RF, Samara
    MS-Off Ver
    Excel 2003&2007
    Posts
    8

    Re: How to go from column-number to column-letter?

    more easy, for all version Excel:

    k= myRange.find(what:="text").column
    x = Split(Cells(1, k).Address, "$")(1)

  6. #6
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: How to go from column-number to column-letter?

    cool, i'll test that one also.

    I actually can get away without it (turns out). I was having trouble with statments like the following (where i is the row number and j the column number).

    Please Login or Register  to view this content.
    but i finally realized what i was passing in and just switched it to:

    Please Login or Register  to view this content.
    That worked just fine

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1