+ Reply to Thread
Results 1 to 3 of 3

Last non-zero number in column where column contains numbers and letters

  1. #1
    Registered User
    Join Date
    11-10-2011
    Location
    Bakersfield, CA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Last non-zero number in column where column contains numbers and letters

    I have a column with zeros, non-zero numbers, and strings. I need to determine the row number that the last non-zero number is in. This previous thread provided a good example, but it wasn't quite what I was looking for. http://www.excelforum.com/excel-prog...ero-value.html

    Here is the code that thread suggested:
    Please Login or Register  to view this content.
    The biggest problem is that the "*" returns the last of EVERYTHING that is not a zero, including strings, which is what I don't want. It should only be the last non-zero number. It's also been a while since I had to program in VBA, so I'm also not entirely sure how to set the row number as a variable using these commands.

    I have no attachment to the above code, so it can be completely scrapped in favor of something else. Thanks in advance.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Last non-zero number in column where column contains numbers and letters

    Try this...

    Please Login or Register  to view this content.

  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: Last non-zero number in column where column contains numbers and letters

    Give this a try:

    Please Login or Register  to view this content.
    _________________
    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!)

+ 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