+ Reply to Thread
Results 1 to 3 of 3

Hide rows if cell value is less than another cell value

  1. #1
    Registered User
    Join Date
    09-23-2014
    Location
    Seattle
    MS-Off Ver
    2010
    Posts
    25

    Hide rows if cell value is less than another cell value

    I have a worksheet with a bunch of rows...

    I'd like to be able to hide the entire row if the value in cell Nx is less than the value in Mx.

    Is this doable in VBA?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Hide rows if cell value is less than another cell value

    Hello nwpassage,

    Change the cell "N1"and "M1"to what you want to use.
    Please Login or Register  to view this content.
    How to Paste a Macro into a Worksheet
    1. Copy the macro with Ctrl+C.
    2. Right Click the Sheet Tab at the bottom of the worksheet.
    3. Click View Code
    4. Paste the macro into the module with Ctrl+V.
    5. Save the macro using Ctrl+S
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Valued Forum Contributor
    Join Date
    10-05-2014
    Location
    Regina, SK Canada
    MS-Off Ver
    Excel for Mac 11
    Posts
    330

    Re: Hide rows if cell value is less than another cell value

    Here's a macro to do the job: (Assuming the data starts on row 4)


    Please Login or Register  to view this content.
    The commented macro code and sample Excel file is attached…
    Attached Files Attached Files
    Last edited by StuCram; 05-23-2015 at 08:13 PM. Reason: Spelling correction in comment; change the IF order

+ 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] First unhide all rows - then hide rows based on specific cell value for a range of cells
    By robbiekh in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-22-2013, 05:46 PM
  2. Hide multiple rows below target cell based on a cell value match elsewhere.
    By tapmagoo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-09-2013, 12:37 PM
  3. Hide rows when a cell value is 0
    By Danielle220188 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-07-2012, 11:51 AM
  4. Hide rows with cell value = 0
    By 95marine in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-13-2012, 02:40 PM
  5. Hide rows by cell value
    By bas_deejay in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-14-2011, 08:31 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