![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 73
|
Did you create the ComboBox using View|Toolbars|Forms?
Yes If so, what is its input range and cell link? Input range is just saying select list AAA or BBB to be appeared to the list box. Does the input range of your combobox contain the list names AAA and BBB? yeah! |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Posts: 73
|
why is my post disappearing???
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Posts: 73
|
ok, i got two ranges. named AAA and BBB
in cell A1 i got a number which is either 1 or 2 controlled by a combo box. i have got a list box that will show list AAA when the number in cell A1 is 1, and show list BBB when the number in cell a1 is 2. how can i do that??? pls help |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Posts: 73
|
pls remember that both range AAA and BBB are already using =offset() stuff, so...
pls help! |
|
|
|
|
|
#5 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
|
Quote:
If so, what is its input range and cell link? Does the input range of your combobox contain the list names AAA and BBB? Aladin |
|
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
|
Hi,
Oops! I misread your post and started on this with option boxes on the userform. Please change the references to the cell A1 value. Here, the option box determines which range appears in the ListBox. Private Sub OptionButton1_Click() Dim AAAItem, Alist UserForm1.ListBox1.Clear Set Alist = Sheets("Sheet1").Range("AAA") For Each AAAItem In Alist UserForm1.ListBox1.AddItem AAAItem Next AAAItem End Sub Private Sub OptionButton2_Click() Dim BBBItem, Blist UserForm1.ListBox1.Clear Set Blist = Sheets("Sheet1").Range("BBB") For Each BBBItem In Blist UserForm1.ListBox1.AddItem BBBItem Next BBBItem End Sub This should get you started. Please post back if you need more details with your particular setup. Bye, Jay |
|
|
|
|
|
#7 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
|
Quote:
We have a range (preferably in a worksheet called Admin), which is named CList, housing the following items: AAA BBB Again, we have in Admin two ranges which are named AAA and BBB. In a worksheet, named say Main, create a combobox, using the option View|Toolbars|Forms in B2, with CList as Input range and with B2 as Cell link. Activate the option Insert|Define|Name. Enter CurList as name in the Names in Worbook box. Enter as formula in the Refers to box: =INDIRECT(INDEX(CList,Admin!$B$2)) Activate OK. Create a listbox in E2 in Main, using the option View|Toolbars|Forms, with CurList as Input range, with E2 as Cell link, and Selection type set to Single. That's all. Aladin |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|