Hi,
Im trying to come up with code that the following sample simulates:
Within an excel table, one of the columns (B) can have different values. There is "Item" and then the rows beneath that row pertain to that specific item, until the next "Item" then it repeats this pattern (the amount of rows beneath an item is variable, not a set amount). For example one item may have 3 rows of "Time". What remains as a constant is whenever there is "Item", that item has its own set of rows pertaining to it, underneath, until the next "Item".
What I want to do in VBA is, create a worksheet change event that when I select "Hide Rows" (from a dropdown list) in cell left of "Item", it hides all rows between that ITEM (row that the "Hide Rows" event trigger is on) and the next ITEM. Then I would also like the reverse option, "Show Rows" to unhide the pertaining rows to the specific item (determined by the event trigger cell to the left of the "Item" trying to unhide row underneath.
Thank you for any help!
Im trying to come up with code that the following sample simulates:
Within an excel table, one of the columns (B) can have different values. There is "Item" and then the rows beneath that row pertain to that specific item, until the next "Item" then it repeats this pattern (the amount of rows beneath an item is variable, not a set amount). For example one item may have 3 rows of "Time". What remains as a constant is whenever there is "Item", that item has its own set of rows pertaining to it, underneath, until the next "Item".
What I want to do in VBA is, create a worksheet change event that when I select "Hide Rows" (from a dropdown list) in cell left of "Item", it hides all rows between that ITEM (row that the "Hide Rows" event trigger is on) and the next ITEM. Then I would also like the reverse option, "Show Rows" to unhide the pertaining rows to the specific item (determined by the event trigger cell to the left of the "Item" trying to unhide row underneath.
Thank you for any help!
A | B | C | |
1 | Dropdown list selection here | Item | |
2 | Costs | This row pertains to Item B1 | |
3 | Time | This row pertains to Item B1 | |
4 | Divider | This row pertains to Item B1 | |
5 | Breakouts | This row pertains to Item B1 | |
6 | Item Divider | This row pertains to Item B1 | |
7 | Dropdown list selection here | Item | |
8 | Costs | This row pertains to Item B7 | |
9 | Time | This row pertains to Item B7 | |
10 | etc... | This row pertains to Item B7 |