I need to hide all rows under "Total" in column B
Got a macro to delete blank rows between the last cell with data and Total, but every time it deletes the hidden cells under total appear, very annoying
Sub HideRowsBelow()
Application.ScreenUpdating = True
Dim mainshseet As Worksheet
Set mainsheet = ActiveWorkbook.Worksheets("Q2")
Dim fRg As Range
Dim lr, i As Long
lr = mainsheet.Cells(Rows.Count, "B").End(xlUp).Row
Set fRg = mainsheet.Cells.Find(what:="Total", lookat:=xlWhole)
For i = lr To (fRg.Row + 1) Step -1
mainsheet.Cells(i, 1).EntireRow.Hide
Next i
End Sub
Can anyone solve this for me please?
Got a macro to delete blank rows between the last cell with data and Total, but every time it deletes the hidden cells under total appear, very annoying
Sub HideRowsBelow()
Application.ScreenUpdating = True
Dim mainshseet As Worksheet
Set mainsheet = ActiveWorkbook.Worksheets("Q2")
Dim fRg As Range
Dim lr, i As Long
lr = mainsheet.Cells(Rows.Count, "B").End(xlUp).Row
Set fRg = mainsheet.Cells.Find(what:="Total", lookat:=xlWhole)
For i = lr To (fRg.Row + 1) Step -1
mainsheet.Cells(i, 1).EntireRow.Hide
Next i
End Sub
Can anyone solve this for me please?
792 | EDQ V Fuse : . | Janette Morris | HHDC |
Total | |||
Last edited: