Hey there. I'd like to hide all rows below the row of a cell with a given value in it.
Here's what the code does currently:
The first line just unhides everything that was previously hidden.
In cells D2:D5 I have the numbers 2,3,4, and 5 each (2 is in D2, 3 is in D3, etc.). In cell F2, I can type in either 2,3,4, or 5 and then run the macro. If the value in F2 matches the value in any of the cells in column D, the given row will be hidden. For instance, if I typed in "3" into cell F2, row 3 would be hidden. Then, if I typed in "4" into cell F2, row 3 would be unhidden and then row 4 would be hidden.
What I want to do though is if I type in "3" in cell F2, it should hide everything BELOW row 3. If I type in "2" in cell F2, it should hide rows 3 and down. Is there a way to do this while keeping the first three lines of the code intact preferably?
Any help would be much appreciated!
Bookmarks