+ Reply to Thread
Results 1 to 9 of 9

Returning Last Value In 2 Colums

  1. #1
    Registered User
    Join Date
    06-08-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    68

    Returning Last Value In 2 Colums

    I would like to get the last value in column A & B and place them into another sheets cell. The number of rows will always be changing too.. In the attached spreadsheet I want the totals, which is the very last value in the colums. I’m still new with VBA but I think it has to have something like this..


    Please Login or Register  to view this content.

    But not sure, thanks for your help!


    Attached is a sample Spreadsheet...
    Attached Files Attached Files
    Last edited by Tyler_Durden; 11-11-2009 at 01:30 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Returning Last Value In 2 Colums

    Hi,

    You don't necessarily need a macro

    Please Login or Register  to view this content.
    will do it.

    Otherwise if you do need a macro

    Please Login or Register  to view this content.
    Rgds
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Returning Last Value In 2 Colums

    Quote Originally Posted by Richard Buttrey View Post
    =INDEX(example!A:A,COUNTA(example!A:A),1)
    I love that formula, Richard. Bravo.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    06-08-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    68

    Re: Returning Last Value In 2 Colums

    Wow that formula is great! I appreciate your quick response!

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Returning Last Value In 2 Colums

    Thanks JB
    The simple ones are always the best.
    Trouble is finding 'em

    Rgds

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Returning Last Value In 2 Colums

    Although, if there are blank rows in A:A, you may have a problem... it will not get the last entry unless those blank cells contain spaces...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Returning Last Value In 2 Colums

    Indeed. Good point which I'd overlooked.

    Maybe better

    Please Login or Register  to view this content.
    Rgds

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Returning Last Value In 2 Colums

    Or just:

    =Lookup(9.999999999e+307,A:A)




    And that is assuming values in A:A are numeric..

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Returning Last Value In 2 Colums

    ....even better.

+ 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