Hello everyone,
Is there any possible way to prevent input lag in a combobox?
I am currently playing around two combobox and whenever I change the value of combobox1 from Item 1 to Item 2 (vice versa) then select combobox2, I notice that the previous value of combobox1 one goes back to the previous value selected then goes to the current value selected in a split second (noticeable enough for me).
Things to know:
- The object was created inside an excel, not inside a form
- It is an activex
- I tried [OFF/ON] screenupdating but the lag still persist
- I notice the said event whenever I click any object/cell that is not combobox1 (after changing the value)
- I tried switch(case) instead of "if" and got the same behavior (split second lag) in the combobox1.text
I'm just nitpicking but if there's a way to further improve this one, please let me know
Sharing the code for your reference:
Is there any possible way to prevent input lag in a combobox?
I am currently playing around two combobox and whenever I change the value of combobox1 from Item 1 to Item 2 (vice versa) then select combobox2, I notice that the previous value of combobox1 one goes back to the previous value selected then goes to the current value selected in a split second (noticeable enough for me).
Things to know:
- The object was created inside an excel, not inside a form
- It is an activex
- I tried [OFF/ON] screenupdating but the lag still persist
- I notice the said event whenever I click any object/cell that is not combobox1 (after changing the value)
- I tried switch(case) instead of "if" and got the same behavior (split second lag) in the combobox1.text
I'm just nitpicking but if there's a way to further improve this one, please let me know
Sharing the code for your reference:
Code:
Private Sub ComboBox1_Change()
If Sheet1.ComboBox1.Text = "Item 1" Then
Sheet1.ComboBox2.Clear
With Sheet1.ComboBox2
.AddItem "abcd"
.AddItem "efgh"
End With
ElseIf Sheet1.ComboBox1.Text = "Item 2" Then
Sheet1.ComboBox2.Clear
With Sheet1.ComboBox2
.AddItem "123"
.AddItem "456"
End With
Else
End If
End Sub