I want to show the value of a combo box in a cell. But before it, I want to clear the items of the combo box and then fill it by items. The below code works but when I add .clear
to the code, It doesn't show the selected value of combo box in cell 1,4. I don't know why.
If I don't add clear
to the code, the items of the combo box will be increased every time I run the program.
Private Sub ComboBox1_change()
With Sheet3.ComboBox1
For Each Cell In Range("A1:A15")
.AddItem Cell.Value
Next
xx = ComboBox1.Value
Set car = Cells(1, 4)
Cells(1, 4).Value = xx
End With
End Sub