user2148238
user2148238

Reputation: 95

Combo Box in VBA Excel

I have a Combo box on sheet1 of a excel workbook. I add some items to it during a process. Once I close the workbook all the items of Combo box are getting cleared. How to avoid this?

    Public Sub ComboBox1_Change() 
    Dim ws As Worksheet 
    Dim match As range 
    Me.ComboBox1.AddItem range("C3").Value 
    End Sub 

Upvotes: 2

Views: 389

Answers (1)

Amadea
Amadea

Reputation: 51

Add items to a range in your worksheet, somewhere hidden, and define a name for that range. In the properties of the combobox under ListFillRange, write the name that you defined for that range.

Upvotes: 2

Related Questions