Pretty new to VBA and I'm trying to clean up the following code so that if the value of cell C964 = 0, then simply hide all the rows in the given range and stop there. Currently, it hides all of the rows and then takes another 30 seconds performing the second If function. I'm hoping you VBA vets can help me out! Thanks!
Sub HideUnusedRowsRS()
Dim cell As Range
For Each cell In Range("B4:B964")
If Range("C964") = 0 Then
Rows("4:964").Hidden = True
ElseIf cell.Value = "" Then
cell.EntireRow.Hidden = True
End If
Next
End Sub
Sub HideUnusedRowsRS()
Dim cell As Range
For Each cell In Range("B4:B964")
If Range("C964") = 0 Then
Rows("4:964").Hidden = True
ElseIf cell.Value = "" Then
cell.EntireRow.Hidden = True
End If
Next
End Sub