I have a spreadsheet (attached) which will sort columns based on different criteria. Once I sort out the columns that I do not need, I would like to then sort and hide rows under the remaining columns which do not have data in that row.
I have this code below which will hide rows which do not have data in them but I must put in the correct area to search. (Set r = Range ("F16:AC1750")
What I would like to have is code which will find the visible remaining columns and put this information into the r= range () to sort/hide the rows.
Thank you
Private Sub Hide_Rows()
Worksheets("BOQMasterList").Activate
Dim r As Range, c As Range
Set r = Range("F16:AC1750")
Application.ScreenUpdating = False
For Each c In r.Rows
If Len(c.Cells(1).Text) + Len(c.Cells(2).Text) = 0 Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next c
Application.ScreenUpdating = True
End Sub
Bookmarks