View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
acw[_2_] acw[_2_] is offline
external usenet poster
 
Posts: 100
Default combo box not updating

Mark

If you have the combobox directly in the spreadsheet from
the control toolbox (ie not on a form which is loaded),
then you can easily have it updated.

Have the part names in a named range which is dynamically
updated. Link the combobox to the named range. Right
click on the sheet tab, select view code and insert the
following in the worksheet change event

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
ComboBox1.ListFillRange = "validnames"
End Sub

This will update the combobox with the updated range
listing.

Tony
-----Original Message-----
Hi.

I'm using a combobox to display a parts list. In the
spreadhseet, there is a range named rgParts, and in the
code, there is a range variable anmed rgParts .

When a part is added, the spreadsheet range name is being
expanded, and the code range variable is being reassigned.

Yet, the parts list displayed in the combo box does not
display the new part until the form has been unloaded and
reloaded.

Is there a way to refresh the list displayed in the
combobox without unloading and reinitializing the form?

Thanks.
Mark
.