G'day,
I am currently looking for a macro which will sequentially select the next visible row in a worksheet when the macro is triggered. I do have a macro which does work however it will select the next row whether that row is hidden or not. My company has a lot of data that is hidden either manually or by filter. I want the macro to be able to select the next visible row and ignore/skip those rows which have been hidden. Here is a copy of the base macro which works fine on a normal worksheet but has no provision to ignore/skip hidden rows:
Sub SelectRowDown()
If ActiveCell.Row < 65536 Then
ActiveCell.Offset(1, 0).Select
ActiveCell.EntireRow.Select
End If
End Sub
If any one knows of a macro that can do this or any help in modifying the macro would be appreciated.
Thanks
Fartnuckles
let me see if I am understanding you correctly. You have a set of data from say rows 1 - 100 what you want is a macro which will take you to Row 100? or to say the next availible row which would be row 101?
One way to achieve this is to check the row height property. If row height is 0, then in must be a hidden row. I have make a simple change to your original code
Sub SelectRowDown()
If ActiveCell.Row < 65536 Then
ActiveCell.Offset(1, 0).Select
Do While ActiveCell.RowHeight = 0
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.EntireRow.Select
End If
End Sub
Regards
Matt
Thanks Mallycat - the modified macro does exactly what I want and works like a charm.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks