+ Reply to Thread
Results 1 to 6 of 6

Hide/Unhide Rows Based On Cell Result

  1. #1
    Registered User
    Join Date
    08-28-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    5

    Hide/Unhide Rows Based On Cell Result

    Hi,

    Im looking for some assitance in writing some code. I am very new at this so sorry if my question seems basic and easy but I have no idea where to start. Basically I am looking at writing code which does the following:

    If A1 = 1 then hide rows 3:10, 11, 15, 19, 20:50 etc

    If A1 = 2 then hide rows 3:10, 15, 29:52, 82

    If A1 = 3 then hide rows 3:20, 95

    If A1 = 4 then hide rows 8:10, 12, 14, 16, 18, 20, 22, 24:60

    Now im able to get the first code which I have written as:

    Please Login or Register  to view this content.
    But as soon as I write the same again chaning 1 to 2, it seems to contridict itself and does nothing. Any help would be greatly appreciated as I really dont know what im doing lol.

    Thanks

    James

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Hide/Unhide Rows Based On Cell Result

    Try this
    Please Login or Register  to view this content.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Hide/Unhide Rows Based On Cell Result

    It's hard to see why it wouldn't work if you added other values in, other than (as previously said) you might have to unhide all rows first.

    How are you adding in the extra value checks for A1?

  4. #4
    Registered User
    Join Date
    08-28-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Hide/Unhide Rows Based On Cell Result

    Hi,

    That worked great. Thank you ever so much for your help.

    Im sure it wont be long till im back with some more easy help required.

    Thank you

    James

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Hide/Unhide Rows Based On Cell Result

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  6. #6
    Registered User
    Join Date
    01-04-2012
    Location
    mpls mn
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Hide/Unhide Rows Based On Cell Result

    Hi: similar problem. Cell A3 contains values from 1-400. For select values (e.g., 1, 2, 6, 7, 9, ...)(35 discrete value) I would like to unhide rows 16:17 and 72:74. For all other values I would like these same rows to remain hidden. Any help on VB code to embed in worksheet is greatly appreciated. - TJ

+ 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