+ Reply to Thread
Results 1 to 7 of 7

hide rows If a cell value is zero.

  1. #1
    Registered User
    Join Date
    12-23-2008
    Location
    Brisbane, Australia.
    MS-Off Ver
    2003
    Posts
    7

    hide rows If a cell value is zero.

    Hi,
    I'm a beginner and need some help....

    How would I write a macro to hide a range of rows If a cell value is zero, then do the same for five additional ranges of rows?

    In my words:
    If AT214=0, hide rows 214 to 244
    and
    If AT245=0, hide rows 245 to 278
    and
    If AT279=0, hide rows 279 to 311
    and
    If AT312=0, hide rows 312 to 344
    and
    If AT345=0, hide rows 345 to 377
    and
    If AT378=0, hide rows 378 to 410

    Any help to put me on the right path would be greatly appreciated!
    Ben
    Brisbane Austraila
    Last edited by VBA Noob; 12-23-2008 at 09:20 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    Put this macro into a Module on your sheet.
    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!)

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482
    Quote Originally Posted by JBeaucaire View Post
    Put this macro into a Module on your sheet.....
    [
    Hi JBeaucaire,
    Are you sure you want this code in a Sheet Module?

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    Hehe, funny how little words trip me up. I just meant to say Module1. It works on Sheet1, but just not where I normally put standard macros.

    Module1.

  5. #5
    Registered User
    Join Date
    12-23-2008
    Location
    Brisbane, Australia.
    MS-Off Ver
    2003
    Posts
    7

    Wink Solved!

    Thank you! thank you! thank you!

    It worked a treat =

  6. #6
    Registered User
    Join Date
    08-24-2011
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: hide rows If a cell value is zero.

    I just stumbled upon this. I have the same issue, except I have cells that are linked to option buttons. I have 24 rows; when the first option button is pressed, only 8 rows have information in them, the others have zeros and I want them hidden. But when the second option button is pressed, now 16 rows have information, the others have zeros. Etc Etc. (5 buttons total) This code works for the first option button that I happen to press, but if i click another, it will not register the number of rows that might contain 0s now. How can I fix this?

    Many thanks.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: hide rows If a cell value is zero.

    By reading the FORUM RULES (link above in the menu bar) and starting your own thread, attach your sample workbook and ask your specific questions there.

    If you find other threads, like this one, to be relevant, include a link to this thread in your own thread.

    Thanks, and welcome to the forum!

+ 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