Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub DropDown2_Initialize()
- Me.DropDown2.AddItem ("all")
- With DropDown2
- Dim year_counter As Integer
- For year_counter = 2012 To 2025
- .AddItem (year_counter)
- Next year_counter
- End With
- End Sub
- Sub DropDown2_Change()
- Call hideAllMonthlySheets
- If DropDown2.Value = "all" Then
- Call showAllMonthlySheets
- ElseIf DropDown2.Value > 2000 Then
- For month_counter = 1 To 12
- Sheets("subtotals-" + DropDown2.Value + "-" + month_counter).Visible = xlSheetVisible
- Next month_counter
- End If
- End With
- End Sub
- Sub showAllMonthlySheets()
- Dim year_counter As Integer
- For year_counter = 2012 To 2025
- Dim month_counter As Integer
- For month_counter = 1 To 12
- Sheets("subtotals-" + year_counter + "-" + month_counter).Visible = xlSheetVisible
- Next month_counter
- Next year_counter
- End Sub
- Sub hideAllMonthlySheets()
- Dim year_counter As Integer
- For year_counter = 2012 To 2025
- Dim month_counter As Integer
- For month_counter = 1 To 12
- Sheets("subtotals-" + DropDown2.Value + "-" + month_counter).Visible = xlSheetHidden
- Next month_counter
- Next year_counter
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement