I'm trying to incorporate these these macros into one where the drop down value would unhide any sheet name starting with that value. I'd also like for it to be an Open Workbook event so that when the workbook is reopened the selected values will stay in place. This is important because there is another macro forcing a user to enable macros that unhides all sheets when the workbook opens.
Macro1
The above needs to be combined with the below:
Thanks for any help.
Macro1
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Me.Range("drop down list value").Address Then
If Target.Value = "2nd" Then
Sheets("any sheet name starting with 2nd...").Visible = True
Else
Sheets("any sheet name starting with 2nd...").Visible = False
End If
End If
End Sub
Code:
Private Sub CommandButton1_Click()
' Unhides all sheets starting with 2nd
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If Left(ws.Name, 3) = "2nd" Then
ws.Visible = xlSheetVisible
End If
Next ws
End Sub