+ Reply to Thread
Results 1 to 4 of 4

Search row from right to left for first non-zero value

  1. #1
    Registered User
    Join Date
    03-07-2007
    Posts
    2

    Search row from right to left for first non-zero value

    Hi there,

    I've got a spreadsheet that has numbers in on particular row (row 21) from E21 to BD21. What I want to do is write something which will START at BD21, check to see if the value is 0, if it is, move left (BC21) and so on until it finds a value which is not zero (ie 100). If a non-zero value is found, then take this value and put it in cell BG21.

    Can someone help please?

    - John

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    John, this should work for you:

    Please Login or Register  to view this content.
    This will return the right-most non-zero value in the range E21:BD21. If you only want to find numbers greater than 0, simply change

    If c.Value <> 0 to If c.Value > 0

  3. #3
    Registered User
    Join Date
    03-07-2007
    Posts
    2

    Talking That works great, thanks!

    Paul that works wonderfully, thanks heaps!

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    You're welcome. Glad to help

+ 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