Hi All,
I can't for the life of me figure out how to do this...basically I am trying to use an IF...THEN formula with ANDs and ORs such as If "A" And "B" Then "Do This" And "Do That".
More specificially, I have two sheets (i.e. "Red" and "Blue")in my workbook and a combo box on each sheet that would call different UserForms. What I am trying to write is...
----------------
Private Sub Workbook_SheetActivate(ByVal Sheet As Object)
If ActiveSheet.Name = "Red" And ComboBox1.Value = "Report 1" Then
Unload UserForm1 And UserForm2.Show
Else Unload UserForm2 and UserForm1.Show
If ActiveSheet.Name = "Blue" And ComboBox2.Value = "Report 1" Then
Unload UserForm4 And UserForm3.Show
Else Unload UserForm3 and UserForm4.Show
----------------
Any help with this would be greatly appreciated! I've tried the SELECT CASE method too but can't get that to work either...HELP!!!!
Thanks,
Neil
I can't for the life of me figure out how to do this...basically I am trying to use an IF...THEN formula with ANDs and ORs such as If "A" And "B" Then "Do This" And "Do That".
More specificially, I have two sheets (i.e. "Red" and "Blue")in my workbook and a combo box on each sheet that would call different UserForms. What I am trying to write is...
----------------
Private Sub Workbook_SheetActivate(ByVal Sheet As Object)
If ActiveSheet.Name = "Red" And ComboBox1.Value = "Report 1" Then
Unload UserForm1 And UserForm2.Show
Else Unload UserForm2 and UserForm1.Show
If ActiveSheet.Name = "Blue" And ComboBox2.Value = "Report 1" Then
Unload UserForm4 And UserForm3.Show
Else Unload UserForm3 and UserForm4.Show
----------------
Any help with this would be greatly appreciated! I've tried the SELECT CASE method too but can't get that to work either...HELP!!!!
Thanks,
Neil