Will rows 4+ initially start as hidden?
If that's true, you could have something like:
Sub Row_Unhiding()
R = 4
Do Until Rows(R).Hidden = True
R = R + 1
If R > 16536 Then
MsgBox "No more rows to unhide!", vbCritical, "Error"
Exit Sub
End If
Loop
Rows(R).Hidden = False
End Sub
Thanks! But its not quite working correctly. I want to unhide only the next unhidden row.
it keeps returning the "no more rows to unhide" error, but does not
unhide anything. Any suggestions?
The macro as written starts on row 4, checks to see if it is hidden,
and goes to the next row if it is visible. Once it finds the first hidden
row (starting its search on row 4), it will unhide that row and stop the macro.
If it gets to the bottom of the sheet and doesn't find any hidden rows, the
macro gives the "no more rows to unhide" error.
Rows are hidden if you selected them earlier and did Format->Row->Hide
or if you set them to height = 0.
The macro also runs on the sheet that is active when you execute the macro.
Let me know if you still have difficulties.