Simple combo box problem


Posted by Gehan on June 30, 2001 3:13 AM

Hi there
I have a combo box with 4 options, each option should take me to a certain page.

Option 1 - Sheet 1
option 2 - Sheet 2. etc...

I tried assigning macro but I can only assign one macro to the combo box, so all the options take me to the same page.

Or I use IF THEN ELSE is it possible to call a macro or jump to another page.

Please help....

Thanks
Gehan

Posted by Cory on June 30, 2001 7:54 AM

Simple combo box solution

If your combobox is on a form then add this code where "sheet1" is your first sheet, so on and so forth:

Private Sub ComboBox1_Change()
If ComboBox1.Value = "sheet1" Then
Sheet1.Activate
ElseIf ComboBox1.Value = "sheet2" Then
Sheet2.Activate
ElseIf ComboBox1.Value = "sheet3" Then
Sheet3.Activate
End If
End Sub

Help?
Cory



Posted by Gehan on June 30, 2001 11:52 AM

Re: Simple combo box solution

Hi there
this didnt work, it gave me a runtime error 424. Is it possible to do it using if then else like if(a32=1,sheet1.Activate)...


Please help me
Thanks