Hi All,
I am hoping someone can help with the below code. Problem seems to be at the "if" part of the code but cannot see my issue. Thanks!
Sub HideRows()
Dim sheetNamesArray
Dim rangesArray
Application.ScreenUpdating = False
Application.Calculation = xlManual
Rows("4:268").Hidden = False
'Array with the names of all of your sheets
sheetNamesArray = Array("SCM 43200", "MatHand 43223", "Ship 43203")
'Array with all of your ranges
rangesArray = Array("T4:T87", "T92:T175", "T185:T268")
'Go through each sheet in the array
For Each sheetName In sheetNamesArray
'Go to each range in the sheet
For Each rangeName In rangesArray
'Hide Lines with Zero value or Blank
For Each cell In rangesArray
If cell.Value = 0 Then Rows(cell.Row).Hidden = True
Next
Next
Next
End Sub
I am hoping someone can help with the below code. Problem seems to be at the "if" part of the code but cannot see my issue. Thanks!
Sub HideRows()
Dim sheetNamesArray
Dim rangesArray
Application.ScreenUpdating = False
Application.Calculation = xlManual
Rows("4:268").Hidden = False
'Array with the names of all of your sheets
sheetNamesArray = Array("SCM 43200", "MatHand 43223", "Ship 43203")
'Array with all of your ranges
rangesArray = Array("T4:T87", "T92:T175", "T185:T268")
'Go through each sheet in the array
For Each sheetName In sheetNamesArray
'Go to each range in the sheet
For Each rangeName In rangesArray
'Hide Lines with Zero value or Blank
For Each cell In rangesArray
If cell.Value = 0 Then Rows(cell.Row).Hidden = True
Next
Next
Next
End Sub