+ Reply to Thread
Results 1 to 6 of 6

Reference last column in worksheet

  1. #1
    Registered User
    Join Date
    01-27-2014
    Location
    Fresno, USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    Reference last column in worksheet

    Greetings,

    I'm trying to dynamically reference the last column using
    Please Login or Register  to view this content.
    . I can't seem to figure out how to convert the column reference from a number to a letter.

    Please Login or Register  to view this content.
    These other methods have failed as well.
    Please Login or Register  to view this content.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,576

    Re: Reference last column in worksheet

    Here, try this

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Reference last column in worksheet

    To convert from number to character a column reference, have a look on next code

    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  4. #4
    Registered User
    Join Date
    01-27-2014
    Location
    Fresno, USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Reference last column in worksheet

    Greetings,

    I have a function which converts a column number reference to a letter reference. However, when I try to pass that converted column letter reference using
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    , I receive a "Run-time error '1004'." I've tested the function using:

    Please Login or Register  to view this content.
    and it correctly displays the column letter.

    Below is my macro and function:

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.

  5. #5
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Reference last column in worksheet

    why not use a column number instead of a letter
    something like this
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-27-2014
    Location
    Fresno, USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Reference last column in worksheet

    The function and macro work correctly. I made the mistake of having put them in a worksheet Microsoft excel object. Thank you very much everyone for your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Formula to return column reference of data looked up from another worksheet
    By pixifaery in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-25-2015, 05:38 AM
  2. [SOLVED] Using variable column reference in VBA worksheet function
    By MariaM02 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-16-2014, 08:10 AM
  3. Use variable column reference in VBA worksheet function
    By MariaM02 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-10-2014, 12:38 PM
  4. Use variable column reference in VBA worksheet function
    By MariaM02 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-08-2014, 08:29 AM
  5. OFFSET function - column reference over the edge of the worksheet
    By ronaldev in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-04-2013, 10:09 PM
  6. Reference cell from another worksheet if Column and Row headings Match
    By s_parker in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-26-2013, 04:46 AM
  7. Reference a column of numbers in another worksheet all at once
    By Cirrus in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-01-2012, 12:20 PM

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