2

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 
1
  • Create a hidden sheet and store the values in that from the combobox before you close the workbook. When you open the workbook later, reload the combo from that. Commented Jan 28, 2014 at 6:47

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

+ 1 Good idea but in this case you need to mention that the user has to add the items to the named range instead of combobox at runtime ComboBox1_Change() else you will get a permission denied error.
Right. Plus, didn't see your comment up there. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.