+ Reply to Thread
Results 1 to 3 of 3

Hide/Unhide Rows in One Worksheet Based on Values in Cells in Another Worksheet

  1. #1
    Registered User
    Join Date
    05-27-2011
    Location
    Phoenix
    MS-Off Ver
    Excel 2007
    Posts
    8

    Hide/Unhide Rows in One Worksheet Based on Values in Cells in Another Worksheet

    Hello,

    Please see the attached workbook. What I am looking to do is when someone opens this workbook, they will start on the "Benefit Info" worksheet. They will look at the benefits available on the sheet, and then go down the list and put in a Y or N based on what benefits are needed.

    What I would like to happen is that when changes are made on the "Benefit Info" worksheet, on the "Benefits at a Glance" worksheet certain rows become hidden. For example, if someone put down Y for Medical, nothing happens, but say they put down an N for GAP, then rows 25:40 on "Benefits at a Glance" are now hidden.

    Conversely, if someone initially puts down a N on one of the options, but then changes it to a Y, then the rows will unhide.

    The rows that will need to be hidden in the event of an N are below:

    Medical - 4:24
    GAP - 25:40
    Critical Assistance - 41:50
    Accident Advance - 51:65
    Dental - 66:77
    Vision - 78:86
    Cancer Select - 87:100

    Unfortunately I have 0 experience with macros/vba, so any help at all will be greatly appreciated.

    Thank you.
    Attached Files Attached Files
    Last edited by xponent_es; 05-27-2011 at 03:28 PM.

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Hide/Unhide Rows in One Worksheet Based on Values in Cells in Another Worksheet

    You would use the worksheet_change event of the Benefit Info sheet. Place this code on the Benefit Info's code page:

    Please Login or Register  to view this content.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Registered User
    Join Date
    05-27-2011
    Location
    Phoenix
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Hide/Unhide Rows in One Worksheet Based on Values in Cells in Another Worksheet

    Wow! Thanks for the quick reply. When I pasted the code, it worked backwards... but I figured I could swap the Y's and N's in the code and sure enough it fixed the issue. Thanks!

+ 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