My goal is to “Reset” to “Clear/Blank/Empty/Nothing” Combobox #3 and #4 on “Change” of Combobox #2
I have a Userform that has 4 Comboboxes, #1 is NOT dependent on ANY and works independently. #2 is the Primary the one ; it IS connected TO, but NOT dependent on either #3 or #4.
Both #3 & #4 ARE dependent on #2.
#4 is also dependent #2, but only really dependent on #3
As I have used a “Change Event” earlier for “cmbExpenditureSubGroups”, it appears I can’t re-use “Change Event” again for the same “Combobox”, just get “Ambiguous Name” error.
So I thought I could try different approach and use “Worksheet_Change(ByVal Target As Range)”
But I can’t get it it to operate;
Relevant info;
Combobox#2 = cmbMainExpenditureGroups
Combobox#3 = cmbExpenditureSubGroups
Combobox#4 = cmbSubGroupsList
and using “Named Ranges” to fill all Comboboxes
This is the code that is not working/resetting things.
I have a Userform that has 4 Comboboxes, #1 is NOT dependent on ANY and works independently. #2 is the Primary the one ; it IS connected TO, but NOT dependent on either #3 or #4.
Both #3 & #4 ARE dependent on #2.
#4 is also dependent #2, but only really dependent on #3
As I have used a “Change Event” earlier for “cmbExpenditureSubGroups”, it appears I can’t re-use “Change Event” again for the same “Combobox”, just get “Ambiguous Name” error.
So I thought I could try different approach and use “Worksheet_Change(ByVal Target As Range)”
But I can’t get it it to operate;
Relevant info;
Combobox#2 = cmbMainExpenditureGroups
Combobox#3 = cmbExpenditureSubGroups
Combobox#4 = cmbSubGroupsList
and using “Named Ranges” to fill all Comboboxes
This is the code that is not working/resetting things.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Address = cmbMainExpenditureGroups Then
Range(cmbExpenditureSubGroups).Value = ""
Range(cmbSubGroupsList).Value = ""
If Target.Address = cmbExpenditureSubGroups Then
Range(cmbSubGroupsList).Value = ""
End If
End If
Application.EnableEvents = True
End Sub