I'm a novice when it comes to macros I'm afraid. I have a spreadsheet that lists work for several members of my team. When it's completed I don't want to delete it, so have a macro to hide all rows where "Y" is entered into the completed column. So far, highlighting all rows and unhiding has been fine as we have had a very small amount of work, but as time goes on and there's more and more it would be much easier to have another button with a 'show all rows' macro assigned to it. Can anyone help me out here?
Thanks very much.![]()
How is the data hidden? By autofilter or by setting the row height to 0?
If it's an autofilter, place the insertion point anywhere in your data, then to toggle the filter on and off:
Selection.AutoFilter
If your question has been satisfactorily addressed, please consider marking it solved. Click here to see how.
Also, you might want to add to the user's reputation by clicking the scales icon - it's why we do what we do...
Thomas Lafferty
Analyst/Programmer
Hi Thomas, thanks for your quick reply. The line from the one I'm using is:
"For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = "Y" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
End If"
Assign to your new button. I assumed sheet1 is called "Sheet1". You may need to edit this.
Sub Unhide() Sheets("Sheet1").UsedRange.EntireRow.Hidden = False End Sub
Sorry if I'm being dense, but do I need to add anything else to that? I'm getting the error:
"Run-time error "9":
Subscript out of range"
What am I doing wrong?
Thanks,
Rob
It's OK, I've got it now after a bit of fiddling. Thank you very much for your help!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks