+ Reply to Thread
Results 1 to 9 of 9

Successive criteria check between cells

  1. #1
    Registered User
    Join Date
    08-09-2014
    Location
    Nigeria
    MS-Off Ver
    MS Office 2010
    Posts
    7

    Successive criteria check between cells

    Good day.
    In a column of value, I want to check each value against the values above it. If the difference is positive, 1 is the output, if negative, -1 and if 0, then 0. My problem is how to loop through the cells starting from the bottom until the top most cell.
    Find attached the sample spreadsheet.

    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Successive criteria check between cells

    I couldn't open your spreadsheet, so you may need to adjust the input and output ranges. I commented it in the code.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-09-2014
    Location
    Nigeria
    MS-Off Ver
    MS Office 2010
    Posts
    7

    Re: Successive criteria check between cells

    Thanks, walruseggman.
    It worked but what I need is to compare a value with other values. The code you helped me with will only compare value with the one above it.
    Can I get one that will compare a value with the ones below it and give me the output of each comparison.

    Thanks so much.

  4. #4
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Successive criteria check between cells

    Please provide an example of what you would like.

  5. #5
    Registered User
    Join Date
    08-09-2014
    Location
    Nigeria
    MS-Off Ver
    MS Office 2010
    Posts
    7

    Re: Successive criteria check between cells

    Ok, thanks
    Find attached the sample spreadsheet.

    Thanks a lot, walruseggman.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Successive criteria check between cells

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-09-2014
    Location
    Nigeria
    MS-Off Ver
    MS Office 2010
    Posts
    7

    Re: Successive criteria check between cells

    Thanks, walruseggman. It worked!! So amazing.
    Please, I would be glad if you can give me links to some books or recommend some for me to increase my knowledge in vba.
    I'm interested in knowing more but over here, there are limited resources to go with.
    Thanks so much.

  8. #8
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Successive criteria check between cells

    Glad it worked. Any reputation points (the star in the lower left of my posts) is appreciated.

    I really can't recommend any VBA books, because I haven't read any. I've just picked up bits and pieces over the last 8 years and refined my style.

  9. #9
    Registered User
    Join Date
    08-09-2014
    Location
    Nigeria
    MS-Off Ver
    MS Office 2010
    Posts
    7

    Re: Successive criteria check between cells

    Thanks for the time.

    I've added the reputation point as requested. Well deserved

+ 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. [SOLVED] countif three successive cells meet a criteria
    By FerLab in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-09-2014, 04:32 PM
  2. Replies: 4
    Last Post: 04-26-2013, 05:09 PM
  3. [SOLVED] Macro to delete lines where there are successive blank cells
    By Footley in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-28-2012, 12:16 PM
  4. detect number of exact successive cells
    By mmatta in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-31-2012, 08:12 PM
  5. Replies: 4
    Last Post: 06-22-2012, 03:16 PM

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