#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default User Form

OK, a newbie at UserForms in Excel. I want to make 2 combo boxes in Excel.
One has a named range which uses the data from the worksheet, which I
figured out, but when an item is chosen in the first combo, I want it to
requery and have a new list of items. What do I do to make this happen.

If Column 1 has Value1, Value2 in the data, then the 1st combo fills with
Value1 and Value2. Also, Column1 in the worksheet looks like this:
Column1
Value1
Value2

Then I have in Columns 2 and 3 the following, which I think I have to do to
represent what data to use for the 2nd combo.
Column2 Column3
Value1 A
Value1 B
Value1 C
Value2 AA
Value2 BB
Value2 CC

So how do I choose Value1 in the first combo (which reads from Column1), and
then have it show A,B,C in the 2nd combo?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default User Form

hi
this is called cascading combos where the second combo displays data based
on what is selected in the first combo.
example code
Private Sub ComboBox1_Change()
If Me.ComboBox1.Value = "1" Then
Me.ComboBox2.RowSource = "B5:B6"
Else
Me.ComboBox2.RowSource = "D5:D6"
End If

regards
FSt1


"Derek Hart" wrote:

OK, a newbie at UserForms in Excel. I want to make 2 combo boxes in Excel.
One has a named range which uses the data from the worksheet, which I
figured out, but when an item is chosen in the first combo, I want it to
requery and have a new list of items. What do I do to make this happen.

If Column 1 has Value1, Value2 in the data, then the 1st combo fills with
Value1 and Value2. Also, Column1 in the worksheet looks like this:
Column1
Value1
Value2

Then I have in Columns 2 and 3 the following, which I think I have to do to
represent what data to use for the 2nd combo.
Column2 Column3
Value1 A
Value1 B
Value1 C
Value2 AA
Value2 BB
Value2 CC

So how do I choose Value1 in the first combo (which reads from Column1), and
then have it show A,B,C in the 2nd combo?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default User Form

Gets me on the right track, but from the data I showed below, I want to
choose an item in the first combo, Value1 or Value2, and use that to filter
the data in the second combo, in which the 1st column has Value1 and/or
Value2, and the 2nd column has the items. How can I do this?


"FSt1" wrote in message
...
hi
this is called cascading combos where the second combo displays data based
on what is selected in the first combo.
example code
Private Sub ComboBox1_Change()
If Me.ComboBox1.Value = "1" Then
Me.ComboBox2.RowSource = "B5:B6"
Else
Me.ComboBox2.RowSource = "D5:D6"
End If

regards
FSt1


"Derek Hart" wrote:

OK, a newbie at UserForms in Excel. I want to make 2 combo boxes in
Excel.
One has a named range which uses the data from the worksheet, which I
figured out, but when an item is chosen in the first combo, I want it to
requery and have a new list of items. What do I do to make this happen.

If Column 1 has Value1, Value2 in the data, then the 1st combo fills with
Value1 and Value2. Also, Column1 in the worksheet looks like this:
Column1
Value1
Value2

Then I have in Columns 2 and 3 the following, which I think I have to do
to
represent what data to use for the 2nd combo.
Column2 Column3
Value1 A
Value1 B
Value1 C
Value2 AA
Value2 BB
Value2 CC

So how do I choose Value1 in the first combo (which reads from Column1),
and
then have it show A,B,C in the 2nd combo?






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default User Form

hi
is this static data or are you adding to it? if you are adding to it you
will have a lot of recodeing to do.
but i think you are setting this up a tad wrong. I would move the value1
data to column 4. or you could set the row source as is rowsource for value1
= column3 rows 1,2 and 3 (or C1:C3?) and set row source for value2 as column3
row 4,5 and 6 (or C4:C5 - assuming column 3 is column C)
your call.
Regards
FSt1

"Derek Hart" wrote:

Gets me on the right track, but from the data I showed below, I want to
choose an item in the first combo, Value1 or Value2, and use that to filter
the data in the second combo, in which the 1st column has Value1 and/or
Value2, and the 2nd column has the items. How can I do this?


"FSt1" wrote in message
...
hi
this is called cascading combos where the second combo displays data based
on what is selected in the first combo.
example code
Private Sub ComboBox1_Change()
If Me.ComboBox1.Value = "1" Then
Me.ComboBox2.RowSource = "B5:B6"
Else
Me.ComboBox2.RowSource = "D5:D6"
End If

regards
FSt1


"Derek Hart" wrote:

OK, a newbie at UserForms in Excel. I want to make 2 combo boxes in
Excel.
One has a named range which uses the data from the worksheet, which I
figured out, but when an item is chosen in the first combo, I want it to
requery and have a new list of items. What do I do to make this happen.

If Column 1 has Value1, Value2 in the data, then the 1st combo fills with
Value1 and Value2. Also, Column1 in the worksheet looks like this:
Column1
Value1
Value2

Then I have in Columns 2 and 3 the following, which I think I have to do
to
represent what data to use for the 2nd combo.
Column2 Column3
Value1 A
Value1 B
Value1 C
Value2 AA
Value2 BB
Value2 CC

So how do I choose Value1 in the first combo (which reads from Column1),
and
then have it show A,B,C in the 2nd combo?







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default User Form

If I have this data:

Form Name 1 a
Form Name 1 b
Form Name 1 c
Form Name 2 aa
Form Name 2 bb
Form Name 2 cc


I want to add it to a combo box on the UserForm, but only add the unique
values. This data is in a static named range. How could I do this?


"FSt1" wrote in message
...
hi
is this static data or are you adding to it? if you are adding to it you
will have a lot of recodeing to do.
but i think you are setting this up a tad wrong. I would move the value1
data to column 4. or you could set the row source as is rowsource for
value1
= column3 rows 1,2 and 3 (or C1:C3?) and set row source for value2 as
column3
row 4,5 and 6 (or C4:C5 - assuming column 3 is column C)
your call.
Regards
FSt1

"Derek Hart" wrote:

Gets me on the right track, but from the data I showed below, I want to
choose an item in the first combo, Value1 or Value2, and use that to
filter
the data in the second combo, in which the 1st column has Value1 and/or
Value2, and the 2nd column has the items. How can I do this?


"FSt1" wrote in message
...
hi
this is called cascading combos where the second combo displays data
based
on what is selected in the first combo.
example code
Private Sub ComboBox1_Change()
If Me.ComboBox1.Value = "1" Then
Me.ComboBox2.RowSource = "B5:B6"
Else
Me.ComboBox2.RowSource = "D5:D6"
End If

regards
FSt1


"Derek Hart" wrote:

OK, a newbie at UserForms in Excel. I want to make 2 combo boxes in
Excel.
One has a named range which uses the data from the worksheet, which I
figured out, but when an item is chosen in the first combo, I want it
to
requery and have a new list of items. What do I do to make this
happen.

If Column 1 has Value1, Value2 in the data, then the 1st combo fills
with
Value1 and Value2. Also, Column1 in the worksheet looks like this:
Column1
Value1
Value2

Then I have in Columns 2 and 3 the following, which I think I have to
do
to
represent what data to use for the 2nd combo.
Column2 Column3
Value1 A
Value1 B
Value1 C
Value2 AA
Value2 BB
Value2 CC

So how do I choose Value1 in the first combo (which reads from
Column1),
and
then have it show A,B,C in the 2nd combo?











  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default User Form

hi
row source will accept named ranges but it can't filter the range. you need
to put your unique values in a seperate named range as i suggested in my last
post.

Regards
FSt1

"Derek Hart" wrote:

If I have this data:

Form Name 1 a
Form Name 1 b
Form Name 1 c
Form Name 2 aa
Form Name 2 bb
Form Name 2 cc


I want to add it to a combo box on the UserForm, but only add the unique
values. This data is in a static named range. How could I do this?


"FSt1" wrote in message
...
hi
is this static data or are you adding to it? if you are adding to it you
will have a lot of recodeing to do.
but i think you are setting this up a tad wrong. I would move the value1
data to column 4. or you could set the row source as is rowsource for
value1
= column3 rows 1,2 and 3 (or C1:C3?) and set row source for value2 as
column3
row 4,5 and 6 (or C4:C5 - assuming column 3 is column C)
your call.
Regards
FSt1

"Derek Hart" wrote:

Gets me on the right track, but from the data I showed below, I want to
choose an item in the first combo, Value1 or Value2, and use that to
filter
the data in the second combo, in which the 1st column has Value1 and/or
Value2, and the 2nd column has the items. How can I do this?


"FSt1" wrote in message
...
hi
this is called cascading combos where the second combo displays data
based
on what is selected in the first combo.
example code
Private Sub ComboBox1_Change()
If Me.ComboBox1.Value = "1" Then
Me.ComboBox2.RowSource = "B5:B6"
Else
Me.ComboBox2.RowSource = "D5:D6"
End If

regards
FSt1


"Derek Hart" wrote:

OK, a newbie at UserForms in Excel. I want to make 2 combo boxes in
Excel.
One has a named range which uses the data from the worksheet, which I
figured out, but when an item is chosen in the first combo, I want it
to
requery and have a new list of items. What do I do to make this
happen.

If Column 1 has Value1, Value2 in the data, then the 1st combo fills
with
Value1 and Value2. Also, Column1 in the worksheet looks like this:
Column1
Value1
Value2

Then I have in Columns 2 and 3 the following, which I think I have to
do
to
represent what data to use for the 2nd combo.
Column2 Column3
Value1 A
Value1 B
Value1 C
Value2 AA
Value2 BB
Value2 CC

So how do I choose Value1 in the first combo (which reads from
Column1),
and
then have it show A,B,C in the 2nd combo?










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
Call user form from ThisWorkbook; close file if form closed XP Excel Programming 2 July 20th 07 07:04 PM
Automatically add a textbox to a user form based on user requireme Brite Excel Programming 4 April 7th 07 11:37 PM
User form ComboBox Items: Remember user entries? [email protected] Excel Programming 0 March 29th 07 06:41 PM
How to: User Form to assign a user defined range to a macro variab TrevTrav Excel Programming 1 March 22nd 05 07:57 PM


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