Hi all,
I have an issue with an ActiveX combobox.
In my workbook, an activeX combobox is created each time a cell is clicked. I would like to trigger an event so that when the value of the combobox change, it triggers an event that modify the adjacent one.
My problem is that, as you know, the ActiveX combobox change doesn't trigger Worksheet_change sub.
That's my code:
I tried to catch the change event using:
That is never fired.
Suggestions?
P.S.: as you can see no name is specified for comboboxes, all those share the same creation code.
I have an issue with an ActiveX combobox.
In my workbook, an activeX combobox is created each time a cell is clicked. I would like to trigger an event so that when the value of the combobox change, it triggers an event that modify the adjacent one.
My problem is that, as you know, the ActiveX combobox change doesn't trigger Worksheet_change sub.
That's my code:
Code:
Dim cb as Combobox
Set cb = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combobox.1", Link:= False, DisplayAsIcon:=False, Left:=currentTarget.Left, Top:=currentTarget.Top, Width:=currentTarget.Width, Height:=currentTarget.Height).Object
cb.LinkedCell = currentTarget.Address
For Each cell in rng1
cb.AddItem cell.value
Next cell
For Each cell in rng2
cb.AddItem cell.value
Next cell
I tried to catch the change event using:
Code:
Private Sub Combobox1_Change()
MsgBox "ok"
End Sub
That is never fired.
Suggestions?
P.S.: as you can see no name is specified for comboboxes, all those share the same creation code.