+ Reply to Thread
Results 1 to 12 of 12

Finding last cell with number in it

  1. #1
    Registered User
    Join Date
    06-17-2015
    Location
    missouri
    MS-Off Ver
    2010
    Posts
    16

    Finding last cell with number in it

    I have sheets that are filled with data that changes once per quarter. The data will start in cell E6 but will be in a different ending point. I need to look up the last cell with data by row and column. I have tried and hit a wall. here is the code I have so far.
    Please Login or Register  to view this content.
    Thanks all.

  2. #2
    Registered User
    Join Date
    04-20-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    51

    Re: Finding last cell with number in it

    You can retrieve the value of the last cell using this formula.
    =INDEX(A:A,MATCH(9.99999999999999E+307,A:A))
    Use Ctrl+Shift+Enter while putting it in to make it an array.

    Are you trying to get the page to take you to the location of the last numeric value in your range?

  3. #3
    Registered User
    Join Date
    06-17-2015
    Location
    missouri
    MS-Off Ver
    2010
    Posts
    16

    Re: Finding last cell with number in it

    What I am trying to do is find the last cell with a number because that range corresponds to a chart on the sheet. The problem comes in because there is a lot more other information on the page in addition to the data I need and the chart. The data starts in Cell E2 but it could end down and to the right at any number of locations

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Finding last cell with number in it

    jrembold, do the columns you are checking have non-numbers down below as well and you only want to check for last NUMBER, or simply last row with data in a few columns?
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  5. #5
    Registered User
    Join Date
    06-17-2015
    Location
    missouri
    MS-Off Ver
    2010
    Posts
    16

    Re: Finding last cell with number in it

    Yes, we are dealing with buildings so when we put a new Building ID in it changes the data. All buildings being different size the data table is rarely the same. So it fills the cells it needs to and every other cell filled with "#NA". I can't go back and change that portion so just trying to work around what is already there

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Finding last cell with number in it

    Yeah no problem... I'm just trying to understand what exactly you need. So there are a number of columns and you want to:
    - find for each one, the last row that has an actual numeric value in it?
    or
    -find, out of all the columns, the last row (in any) that has an actual number in it?
    or
    -one of the above but N/A also counts?

  7. #7
    Registered User
    Join Date
    06-17-2015
    Location
    missouri
    MS-Off Ver
    2010
    Posts
    16

    Re: Finding last cell with number in it

    "#NA" is just a filler, so I do not want to find that.
    The data I am trying to find eventually goes into a chart on the same worksheet. When we put in new data the chart changes but tries to keep the old data and match it with the new.
    So my goal to get started with a macro that makes the new data seamlessly enter the new chart is by finding the first and last cell with the important data (numbers instead of #NA) and then select that range of data.
    So basically find the top left and bottom right corners of the box and then connect the dots giving me the entire box of data.
    With this in mind I need the cell that is the last in the box that has a number in it. Basically the last "hit" Battleship haha

    hopefully this helps

  8. #8
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,541

    Re: Finding last cell with number in it


  9. #9
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Finding last cell with number in it

    So the "top left" will be in column E? and the bottom right... is that a fixed column as well? or can that vary?

  10. #10
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Finding last cell with number in it

    If I've understood correctly then try this out:

    Please Login or Register  to view this content.
    Last edited by Arkadi; 06-19-2015 at 08:55 AM.

  11. #11
    Registered User
    Join Date
    06-17-2015
    Location
    missouri
    MS-Off Ver
    2010
    Posts
    16

    Re: Finding last cell with number in it

    Arkadi!!! thanks for your help so far. You are saving me. The values we need to be fluid are $D$40 and $G$5:$AK$40.

    $D$40 = Value in E1 on active sheet
    $G$5 = Value in E2 on active sheet
    $AK$40 = Value in E3 on active sheet

    And we can make this apply to the chart in the active sheet as we loop through all our sheets (we already have the loop but need this macro to engage the chart on the active sheet). here is what happened when I recorded a macro of choosing the cells you found.

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    06-17-2015
    Location
    missouri
    MS-Off Ver
    2010
    Posts
    16

    Re: Finding last cell with number in it


+ 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. Finding a Cell Address using the Max number in a row
    By NeoFlex in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-14-2014, 09:03 AM
  2. Finding the Row Number of the next cell with a Value in a Column
    By JoshExcel in forum Excel Formulas & Functions
    Replies: 26
    Last Post: 06-05-2013, 12:03 PM
  3. finding the cell number using C++
    By garywillams in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-29-2009, 04:22 AM
  4. Finding a Row Number for a cell
    By supernova5271 in forum Excel General
    Replies: 3
    Last Post: 09-30-2008, 06:58 PM
  5. Replies: 1
    Last Post: 09-12-2005, 09:05 AM

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