Youseepooo
New Member
- Joined
- Feb 5, 2019
- Messages
- 37
Hey i have this code that i use to sort my worksheet however i want to include a special provision where if the text in the Range of column "C" equals "TOTAL" do not hide the empty row under it.
For example i want the worksheet to have a row separating my tables after the, text TOTAL.
Right now it hides every row with a empty space in the range but i want to not hide the row if the cell above that CURRENT cell reads "TOTAL"
this is the code :
Code:
Dim xRg As Range Application.ScreenUpdating = False
For Each xRg In Range("C3:C420")
If xRg.Value = "" Then
xRg.EntireRow.Hidden = True
Else
xRg.EntireRow.Hidden = False
End If
Next xRg
Application.ScreenUpdating = True
For example i want the worksheet to have a row separating my tables after the, text TOTAL.
Right now it hides every row with a empty space in the range but i want to not hide the row if the cell above that CURRENT cell reads "TOTAL"
this is the code :
Code:
Dim xRg As Range Application.ScreenUpdating = False
For Each xRg In Range("C3:C420")
If xRg.Value = "" Then
xRg.EntireRow.Hidden = True
Else
xRg.EntireRow.Hidden = False
End If
Next xRg
Application.ScreenUpdating = True