Sub Hide()
Dim wks As Worksheet
On Error Resume Next
For Each wks In ThisWorkbook.Worksheets
With wks
wks.Select
LastRow = Range("A65536").End(xlUp).Row '
Set Rng = Range("A1:A" & LastRow) 'choose column where value exists
For Each cell In Rng
If cell.Value = "0" Then 'Change the value based on which the rows need to be hidden
cell.EntireRow.Hidden = True
End If
Next cell
End With
Next wks
End Sub
Option Explicit
Sub Hide()
Application.ScreenUpdating = False
Dim wks As Worksheet
Dim Lastrow As String
Dim Rng As Range
Dim cell As Range
On Error Resume Next
For Each wks In ThisWorkbook.Worksheets
With wks
wks.Select
Rows.Hidden = False
Lastrow = Range("A" & Rows.Count).End(xlUp).Row '
Set Rng = Range("A1:A" & Lastrow) 'choose column where value exists
For Each cell In Rng
If cell.Value = "0" Then 'Change the value based on which the rows need to be hidden
cell.EntireRow.Hidden = True
End If
Next cell
End With
Next wks
MsgBox "All Rows containing Zero in Column A have been hidden", vbInformation, "Information"
Application.ScreenUpdating = True
End Sub
Sub Hide()
Dim Lastrow As String
Dim Rng As Range, cell As Range
Application.ScreenUpdating = False
On Error Resume Next
With ThisWorkbook.Worksheets("Sheet1")
.Rows.Hidden = False
.Cells(.Rows.Count, 1).Select
If ActiveCell.Value = "" Then
Lastrow = Selection.End(xlUp).Row
Else
Lastrow = Rows.Count
End If
Set Rng = Range("A1:A" & Lastrow) 'choose column where value exists
For Each cell In Rng
If cell.Value = "0" Then 'Change the value based on which the rows need to be hidden
cell.EntireRow.Hidden = True
End If
Next cell
End With
MsgBox "All Rows containing Zero in Column A have been hidden", vbInformation, "Information"
Application.ScreenUpdating = True
End Sub