I have just come across a problem relating to the resulting code from this thread.
I hope I’m not doing the wrong thing posting here, after a solution had been found.
The following code works beautifully on its own.
Private Sub ComboBox1_Change()
Static Blocked
If Blocked Then Exit Sub
Blocked = True
Select Case ComboBox1.Value
Case "Current Day"
For Each sht In ThisWorkbook.Sheets
If sht.Range("O2").Value = Date Then
sht.Select
Exit For
End If
Next sht
Case Else
Sheets(ComboBox1.Value).Select
End Select
Me.ComboBox1.Value = "" ' or "Choose Sheet" or…
Blocked = False
End Sub
I then added code which hides and unhides selected sheets. This code courtesy of xld.
Private Sub ToggleButton1_Click()
Dim i As Long
For i = 1 To 7
Worksheets("Day " & i).Visible = Not Worksheets("Day " & i).Visible
Next i
End Sub
The problem is everything works well, unless the ‘Current Day’ sheet from the first bit of code, happens to be hidden by the second piece of code.
I would like to keep both pieces of code.
Is this an easy fix, or am I asking too much?
Thanks again.