I have several cascading ComboBoxes & would like to close Cbo2 & open Cbo1
when there is an error. These CboBoxes are on an Excel spreadsheet, not a UserForm.
I have the following code, if the Dropdown is opened it requeries Cbo2 to
ListIndex = 0. But I also want it to close (unselect, undrop list) Cbo2 &
open (select, dropdown) Cbo1 on MsgBox error. This insures the user selects
property of Cbo1 first.
--
Thanks, Kevin
when there is an error. These CboBoxes are on an Excel spreadsheet, not a UserForm.
I have the following code, if the Dropdown is opened it requeries Cbo2 to
ListIndex = 0. But I also want it to close (unselect, undrop list) Cbo2 &
open (select, dropdown) Cbo1 on MsgBox error. This insures the user selects
property of Cbo1 first.
Code:
Private Sub cbo2_MouseDown(ByVal Button As Integer, _ ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) If Cbo1.Value = "0" Then MsgBox "Error, choose ComboBox1, first" Cbo2.ListIndex = 0 'I want to deselect the Cbo2 DropDown Cbo2.DropDown = False 'Compile error here 'Select Cbo1, like Select.Range Cbo1.DropDown Else Cbo2.ListIndex = 0 End If End Sub
Thanks, Kevin
Comment