I'm building a custom price list for each state, but rather than always have 50+ worksheets showing I only want those showing that are going to be used. To filter the visible worksheets, I'm using checkboxes on an intro page to change values in column A, then running a VBA macro to hide/unhide worksheet names based on those column A values. This works great for the most part, but I'm running into a run-time error '13' anytime I try to unhide two worksheets that are next to one another. Each can hide/unhide individually, or with any other worksheet that isn't immediately next to it. I initially though separating the column A values might fix it, but it didn't.
Any ideas on why this error would be happening or how to fix it?
Any ideas on why this error would be happening or how to fix it?
VBA Code:
Sub Arizona()
Dim HideSheet As Boolean
HideSheet = Range("A8")
If HideSheet Then
Sheets("Arizona").Visible = True
Else
Sheets("Arizona").Visible = False
End If
End Sub
VBA Code:
Sub Arkansas()
Dim HideSheet As Boolean
HideSheet = Range("A10")
If HideSheet Then
Sheets("Arkansas").Visible = True
Else
Sheets("Arkansas").Visible = False
End If
End Sub