+ Reply to Thread
Results 1 to 8 of 8

Convert Column Number to Letter VBA

  1. #1
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Convert Column Number to Letter VBA

    Hi All,

    I believe this should be fairly simple, but i just cannot put my finger on what to do. I am trying to get a column number reference to be its corresponding letter.

    Here is the chunk of my code, obviosly the highlighted part is not working properly as of right now because my column is being referenced as a number. Is there some easy way to go about changing this without using mod or anything else. I am looking for a quick fix. Thanks for any help.

    Please Login or Register  to view this content.
    Regards,
    amotto

    If I helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Convert Column Number to Letter VBA

    Would this code replace the code you currently have? (NOTE: I'm pasting the copied range to a random cell, A99. Change that as necessary)

    Let me know if it helps

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    05-07-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    354

    Re: Convert Column Number to Letter VBA

    Please Login or Register  to view this content.
    Above will convert column number to letter. not my code...can't remember where i got it

    you can also do:

    Please Login or Register  to view this content.
    Regards,
    Vandan

  4. #4
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: Convert Column Number to Letter VBA

    Thank you all for the help, i ended up using vandans second post because it was less work, but i can see how both of yours help. Thanks again!

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Convert Column Number to Letter VBA

    You don't need the column letter:

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Registered User
    Join Date
    08-20-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Convert Column Number to Letter VBA

    thanks for the info
    Last edited by soporific; 10-18-2012 at 06:00 PM.

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Convert Column Number to Letter VBA

    Sopoforic

    This works for AA and further.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-20-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Convert Column Number to Letter VBA

    Norie, thanks for that but it was my bad, i was stripping out the first letter myself

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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