Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Linking Combo Boxes

I want to have a combo box data change based on what another combo boxes
selected value is. Is this possible in Excel 2000, and if so how?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Linking Combo Boxes

One way is to use a range name to access your data for the combo box that
has variable data, and in the other combo assign a macro that changes the
cells defined by the range name according to the selection in this combo
box.


"chwillis" wrote in message
...
I want to have a combo box data change based on what another combo boxes
selected value is. Is this possible in Excel 2000, and if so how?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Linking Combo Boxes

Hi,
Something along these lines should help:


Combobox1 is initialized with list of car manufacturers based on named range
"Manufacturers".

When combobox1 is selected, combobox2 is loaded with models from named
range; if manufacturer is "Ford" then named range is "Ford_Models".
Similarly, combobox3 is loaded with colours for a given model e.g. named
range "Fiesta_Colours" (UK car models here!)

You could use arrays of named ranges in combination with the ListIndex of a
combobox (or both) to get the date to be loaded.I personally think named
ranges are the best way of organising the data.

HTH

Private Sub Combobox1_Change()
Dim rng As Range, cell As Range
' Set combobox2 with list of models for given manufacturer
Set rng = Range(ComboBox1.Value & "_Models")
ComboBox2.Clear
For Each cell In rng
ComboBox2.AddItem cell.Value
Next cell
End Sub

Private Sub Combobox2_Change()
Dim rng As Range, cell As Range
' Set combobox3 with list of colours for given model
Set rng = Range(ComboBox2.Value & "_Colours")
ComboBox3.Clear
For Each cell In rng
ComboBox3.AddItem cell.Value
Next cell
End Sub

Private Sub Userform_Initialize()
Dim rng As Range, cell As Range
Set rng = Range("Manufacturers")
For Each cell In rng
ComboBox1.AddItem cell.Value
Next cell
End Sub


HTH

"chwillis" wrote:

I want to have a combo box data change based on what another combo boxes
selected value is. Is this possible in Excel 2000, and if so how?

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
Getting Combo boxes to change options based on other Combo boxes. Ancient Wolf New Users to Excel 1 March 27th 09 06:29 PM
Linking Combo Boxes (Please Help) Mika Excel Worksheet Functions 0 January 8th 07 07:05 PM
Linking multiple combo boxes Subs Excel Programming 4 May 19th 05 12:52 AM
Linking Combo Boxes dogo Excel Programming 3 September 30th 04 11:59 PM
excel 97: linking 2 combo boxes JMCN Excel Programming 1 October 22nd 03 11:05 PM


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