Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   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 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Combo Box Changes When Opening Workbook

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

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

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Combo Box Changes When Opening Workbook

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

  #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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
combo box - opening a workbook andrew Excel Discussion (Misc queries) 0 May 22nd 07 10:34 AM
Combo box list w/ data in 2nd workbook without opening both files MHCPO Excel Worksheet Functions 0 December 15th 05 07:15 PM
excel VBA problem - setting workbook as variable & opening/re-opening safe Excel Programming 1 August 20th 04 12:22 AM
How to make the opening of a workbook conditional upon the opening of another workbook Marcello do Guzman Excel Programming 1 December 16th 03 06:09 AM
How to make opening of workbook conditional of opening of another workbook turk5555[_2_] Excel Programming 2 December 15th 03 11:07 PM


All times are GMT +1. The time now is 02:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"