vasim
Member
Hello,
I have a combobox in which there are months form Jan to Dec and 1 as All,
There are a total of 12 sheets named as Jan 2010, Feb 2010...till Dec 2010, now when I select Jan in combobox and go the Jan 2010 sheet opens, the only problem is when I click All and go all the hidden sheets do not become visible. Help please
Private Sub CommandButton1_Click()
Dim x As String
Dim y As String
Dim Wsname As Variant
y = "2010"
x = combobox1.Value
If combobox1.Value = "All" Then
Application.Worksheets(array("" * " & y", "" * " & y")).Visible = True
Else
Application.Worksheets(x & " " & y).Visible = True
End If
Unload Me
End Sub
I know that the array is not working as the shets are hidden can i get some thing to solve....
I have a combobox in which there are months form Jan to Dec and 1 as All,
There are a total of 12 sheets named as Jan 2010, Feb 2010...till Dec 2010, now when I select Jan in combobox and go the Jan 2010 sheet opens, the only problem is when I click All and go all the hidden sheets do not become visible. Help please
Private Sub CommandButton1_Click()
Dim x As String
Dim y As String
Dim Wsname As Variant
y = "2010"
x = combobox1.Value
If combobox1.Value = "All" Then
Application.Worksheets(array("" * " & y", "" * " & y")).Visible = True
Else
Application.Worksheets(x & " " & y).Visible = True
End If
Unload Me
End Sub
I know that the array is not working as the shets are hidden can i get some thing to solve....