+ Reply to Thread
Results 1 to 5 of 5

How to hide rows based on cell value, row range is dynamic.

  1. #1
    Registered User
    Join Date
    05-16-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    63

    How to hide rows based on cell value, row range is dynamic.

    I'm pretty new to VBA so my knowledge is pretty low. I've been searching various forums for this, but can't modify the code I've see to fit what I'm doing.

    I have a spreadsheet that has a dynamically changing number of rows. I need to hide(or filter out) all rows with a cell value not equal to 0 in column G starting at row G4 down(G3 is my header row).

    I already have several iterations of various For/each and Case statements but can't modify them correctly to apply to my situation.

    Any help would be greatly appreciated.


    Thanks,

  2. #2
    Registered User
    Join Date
    07-12-2012
    Location
    New Hampshire, United States
    MS-Off Ver
    Excel 2010
    Posts
    80

    Re: How to hide rows based on cell value, row range is dynamic.

    See if this code helps:

    Please Login or Register  to view this content.
    Put it in your the object of whichever sheet you are using, not a module. This will run every time the sheet is updated. Let me know how this works.

  3. #3
    Registered User
    Join Date
    05-16-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: How to hide rows based on cell value, row range is dynamic.

    Carrob,

    Thanks for the reply, but I don't know where to put that. I tried adding it in the same "page" as the rest of the macro and then calling it, but that didn't work.

    ---------- Post added at 12:15 PM ---------- Previous post was at 12:13 PM ----------

    I almost go this to work

    Please Login or Register  to view this content.
    The only problem is that it now filters out ALL values(except the header) in Column G.

    Thanks,

    Craig
    Last edited by Cutter; 08-03-2012 at 05:04 PM. Reason: Removed whole post quote

  4. #4
    Registered User
    Join Date
    07-12-2012
    Location
    New Hampshire, United States
    MS-Off Ver
    Excel 2010
    Posts
    80

    Re: How to hide rows based on cell value, row range is dynamic.

    Put this in a module:

    Please Login or Register  to view this content.
    Let me know if this works.

  5. #5
    Registered User
    Join Date
    05-16-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: How to hide rows based on cell value, row range is dynamic.

    I got it to work:

    Please Login or Register  to view this content.
    Thanks,

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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