John Sadler
New Member
- Joined
- May 1, 2012
- Messages
- 48
Hi folks ... the code below was working but suddenly stopped with Error 13 Type Mismatch where 'If ws.Range("U1") = "Active" And ws.Range("U2") = "Outbound" Then' was highlighted as the problem. If I remove 'And ws.Range("U2") = "Outbound" ' it will show all sheets where U1 = Active.
So was working but not now
Sub HideOutboundSheets()
Application.ScreenUpdating = False
Dim ws As Worksheet
For Each ws In Worksheets
If ws.Range("U1") = "Active" And ws.Range("U2") = "Outbound" Then
ws.Visible = False
End If
Next ws
Application.ScreenUpdating = True
End Sub
So was working but not now
Sub HideOutboundSheets()
Application.ScreenUpdating = False
Dim ws As Worksheet
For Each ws In Worksheets
If ws.Range("U1") = "Active" And ws.Range("U2") = "Outbound" Then
ws.Visible = False
End If
Next ws
Application.ScreenUpdating = True
End Sub