Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Populating a combo box at run time

Hi, I have a couple of comboboxes - the contents of the second are dependent
on the selection in the first one. I have this part running fine. the
problem I am having is that when a new option is selected in the first combo
box the contents of the second combobox do not change until the
dropbuttonclick even.

To make things clear here is the order of operations:

user clicks the drop down arrow on combobox 1 user then makes a selection
from combobox 1 this calls the code to populate the second combobox
dependant on what user has selected THIS IS WHERE THE PROBLEM IS -
basically i want the first option of the new list to be automatically
displayed in the combobox now - however, the old value is left there until
the user clicks the drop down arrow.

Hope this makes sense. Can anyone help me out?

thanks for reading this.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Populating a combo box at run time

Private Sub combobox1_Click()

' code that populates comobobox2

Combobox2.Listindex = 1
End sub

--
Regards,
Tom Ogilvy


"Graham Whitehead" wrote:

Hi, I have a couple of comboboxes - the contents of the second are dependent
on the selection in the first one. I have this part running fine. the
problem I am having is that when a new option is selected in the first combo
box the contents of the second combobox do not change until the
dropbuttonclick even.

To make things clear here is the order of operations:

user clicks the drop down arrow on combobox 1 user then makes a selection
from combobox 1 this calls the code to populate the second combobox
dependant on what user has selected THIS IS WHERE THE PROBLEM IS -
basically i want the first option of the new list to be automatically
displayed in the combobox now - however, the old value is left there until
the user clicks the drop down arrow.

Hope this makes sense. Can anyone help me out?

thanks for reading this.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Populating a combo box at run time

Ok, my problem is how do you do the first part of your post?

I have a combobox that I need to pick up a list which is determined by
another combobox. i.e combobox1 is criteria A, I then need all the data in
another sheet that one column matches this criteria to be available in
combobox2. I have too many records to manually sort and is not practical to
have to create lists manually. What I need is some way of picking out all of
criteria A automatically.

Hope you can help, thanks.


"Tom Ogilvy" wrote:

Private Sub combobox1_Click()

' code that populates comobobox2

Combobox2.Listindex = 1
End sub

--
Regards,
Tom Ogilvy


"Graham Whitehead" wrote:

Hi, I have a couple of comboboxes - the contents of the second are dependent
on the selection in the first one. I have this part running fine. the
problem I am having is that when a new option is selected in the first combo
box the contents of the second combobox do not change until the
dropbuttonclick even.

To make things clear here is the order of operations:

user clicks the drop down arrow on combobox 1 user then makes a selection
from combobox 1 this calls the code to populate the second combobox
dependant on what user has selected THIS IS WHERE THE PROBLEM IS -
basically i want the first option of the new list to be automatically
displayed in the combobox now - however, the old value is left there until
the user clicks the drop down arrow.

Hope this makes sense. Can anyone help me out?

thanks for reading this.



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
Excel VBA Combo Box Populating dependent on other combo box choices ikabodred Excel Programming 1 March 15th 06 03:16 PM
Populating Combo Boxes Tyrell Excel Programming 1 March 12th 06 02:38 PM
Populating a combo box John in Surrey Excel Programming 1 February 8th 06 04:56 PM
Populating a Combo Box Bryan Excel Programming 1 February 25th 05 06:50 PM
Populating Combo Boxes Tom Ogilvy Excel Programming 0 September 25th 03 04:29 AM


All times are GMT +1. The time now is 04:39 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"