View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JP JP is offline
external usenet poster
 
Posts: 103
Default Combo Box Changes When Opening Workbook

I have not set the controlsource. I don't see that as an item in the
properties window though.

"Net_prof" wrote:

Have you defined the .ControlSource property for the combobox? I believe if
you only define the ListFillRange and do not define the ControlSource, your
list value will get reset every time you reinitialize the control (i.e.
reopen the form or workbook/sheet).

But I like to have better control, so I avoid using ListFillRange and just
use the .AddItem or .List() to populate either Combobox or Listbox controls,
then define the ControlSource property where I want to save for next time if
I want to retrieve a previously selected value from the list.




"JP" wrote:

the items really don't change but the order is not what is giving me the
trouble. I'll save the product name in the combo box but when opening the
workbook at a later time, i'll see the product i selected for a brief second
and then it switches to the product name which has the same price as the one
I selected in the first place.

"Net_prof" wrote:

If these items do not change, populate the Combobox with the
Workbook_Activate event and reference the cell containing the price with the
.additem property instead of using the ListFillRange property. This way you
can control the order the products show up in the combobox.

net_prof



"JP" wrote:

I have a combo box that is populated by using the ListFillRange property.
When selecting the combo box item ("product"), the price is displayed in the
next column.
Pretty straightforward. But, there are several products with the same
price. If I select a product with the same price as another product, save
the workbook, and the close it, the next time I open the workbook the text in
the combo box changes to the first product with the same price. How do I
keep this from happening?

Thanks