Mattandy55
New Member
- Joined
- May 27, 2016
- Messages
- 20
I have a code that should be basic enough.. But for some reason when running it doesn't work correctly for Idaho and Colorado. It hides Colorado and Idaho even though B2 on each sheet aren't 0. Job Data, Arizona, and Utah all work perfectly. Any assistance is greatly appreciated.
VBA Code:
Sub HideSheets()
Application.DisplayAlerts = False
Sheets("Job Data").Select
If [A3] = 0 Then
Sheets("Job data").Visible = False
Else
Sheets("Job Data").Visible = True
End If
Sheets("Arizona").Select
If [B2] = 0 Then
Sheets("Arizona").Visible = False
Else
Sheets("Arizona").Visible = True
End If
Sheets("Utah").Select
If [B2] = 0 Then
Sheets("Utah").Visible = False
Else
Sheets("Utah").Visible = True
End If
Sheets("Colorado").Select
If [B2] = 0 Then
Sheets("Colorado").Visible = False
Else
Sheets("Colorado").Visible = True
End If
Sheets("Idaho").Select
If [B2] = 0 Then
Sheets("Idaho").Visible = False
Else
Sheets("Idaho").Visible = True
End If
Application.ScreenUpdating = True
End Sub
Last edited by a moderator: