+ Reply to Thread
Results 1 to 4 of 4

Hiding Rows Conditionally

  1. #1
    Registered User
    Join Date
    02-02-2005
    Posts
    3

    Unhappy Hiding Rows Conditionally

    Hi,

    I am trying to create the following:

    I have a cell which contains a list which I created using Data/Validation. Now I want that certain rows in another sheet in the same file are shown or hidden depending on which item I select from the list. How can I do this?

    I am new at programming in Excel, so a simple explanation would be great! Thanks!

    Philip

  2. #2
    Registered User
    Join Date
    01-09-2005
    Location
    London, UK
    Posts
    47
    How about using the AutoFilter command on the second worksheet?

    Data>Filter>AutoFilter

  3. #3
    Registered User
    Join Date
    02-02-2005
    Posts
    3
    I cannot use Autofilter in this case. Maybe some clarification:

    I have a workbook with about 16 sheets. On the first sheet is a drop down list as I explained before. When I select the first item in the list, I want to hide rows 2-10 in ALL the other sheets. When I select the second item, I want to hide rows 3-10 in all sheets and so on. How can I do this?

    Thanks in advance!

    Philip

  4. #4
    Registered User
    Join Date
    01-09-2005
    Location
    London, UK
    Posts
    47
    I'm rather new to VBA as well, but I'm pretty sure you could find a way to write a Macro that would call up the AutoFilter command on each of the pages using your chosen value as the Filter criteria.

    I'd look into it myself if I had a bit more time, but if no one else has any suggestions, I'd suggest you look up AutoFilter in VBA Help, and see what you get.

    I know you can call up Excel formulas using the Application.{Formula_Name} string, so there's probably something similar for Filter.

    Alternately... you could try running a search of all cells in that column which don't match your selected cell, and set their Row Height to 0. (Come to think of it, that's probably the best way.) You could either set it to Loop through the desired worksheets or use Union to select them all at once (I think Union works on multiple worksheets).

    Again, you'd have to look up what the formatting commands are in VBA, sorry I don't have the time to look them up for you now. (I'm still waiting for someone to answer MY question from this morning, ha!)
    Last edited by Montrose77; 02-02-2005 at 10:43 AM.

+ 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