ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How Do I Load A ComboBox RowSource From The Results Of Another ComboBox (https://www.excelbanter.com/excel-programming/314791-how-do-i-load-combobox-rowsource-results-another-combobox.html)

Minitman[_4_]

How Do I Load A ComboBox RowSource From The Results Of Another ComboBox
 
Greetings

I have 2 ComboBoxes on a UserForm called CBox1 and CBox2. CBox1 works
fine. It looks to get 1 of five names. I have five named ranges with
the same names as the five choices that CBox1 can choose from. I need
for CBox2 to load the named range with the same name as CBox1's
choice.

I tried but it would not accept my entry into the RowSource property.

Is this even possible?

Any help would be most appreciated.

TIA

-Minitman

Chip Pearson

How Do I Load A ComboBox RowSource From The Results Of Another ComboBox
 
Try something like

Private Sub Combo1_Change()
Dim Rng As Range
With ComboBox1
.Clear
For Each Rng In Range(.List(.ListIndex))
ComboBox2.AddItem Rng.Text
Next Rng
End With
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Minitman" wrote in message
...
Greetings

I have 2 ComboBoxes on a UserForm called CBox1 and CBox2.
CBox1 works
fine. It looks to get 1 of five names. I have five named
ranges with
the same names as the five choices that CBox1 can choose from.
I need
for CBox2 to load the named range with the same name as CBox1's
choice.

I tried but it would not accept my entry into the RowSource
property.

Is this even possible?

Any help would be most appreciated.

TIA

-Minitman




Bob Phillips[_6_]

How Do I Load A ComboBox RowSource From The Results Of Another ComboBox
 
Does this do it for you?

CBox2.RowSource = Range(CBox1.Value).Address

--

HTH

RP

"Minitman" wrote in message
...
Greetings

I have 2 ComboBoxes on a UserForm called CBox1 and CBox2. CBox1 works
fine. It looks to get 1 of five names. I have five named ranges with
the same names as the five choices that CBox1 can choose from. I need
for CBox2 to load the named range with the same name as CBox1's
choice.

I tried but it would not accept my entry into the RowSource property.

Is this even possible?

Any help would be most appreciated.

TIA

-Minitman




Minitman[_4_]

How Do I Load A ComboBox RowSource From The Results Of Another ComboBox
 
Hey Bob,

Yes it does!!! Thanks,

And thanks also to Chip for his contribution, it also works - Thanks
Chip.

Please, keep up the good work - Both of you.

-Minitman



On Tue, 26 Oct 2004 19:33:52 +0100, "Bob Phillips"
wrote:

Does this do it for you?

CBox2.RowSource = Range(CBox1.Value).Address




All times are GMT +1. The time now is 09:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com