Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Working with 2 drop down list
I have 2 drop down list on my spreadsheet. #1 is the master and #2 is based
on selection from #1. For example: if a user select "Auto" in list #1, then in list #2, only a list of Auto will be filled in. My question is when I select a value in List#1 it automatically run both subs combobox1_change and combobox2_change. It doesn't allow the user the select the drop down list #2. Can someone help me so that only sub combobox2_change runs only when drop down list #2 is selected. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Working with 2 drop down list
Take a look here at Debra Dalgliesh's tip on dependent lists using Data
Validation - This may be a mor elegant way of solving your problem.:- http://www.contextures.com/xlDataVal02.html -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 00/02/03 ---------------------------------------------------------------------------- Newsgroups - Where you really can get a free lunch!! ---------------------------------------------------------------------------- "Kim" wrote in message ... I have 2 drop down list on my spreadsheet. #1 is the master and #2 is based on selection from #1. For example: if a user select "Auto" in list #1, then in list #2, only a list of Auto will be filled in. My question is when I select a value in List#1 it automatically run both subs combobox1_change and combobox2_change. It doesn't allow the user the select the drop down list #2. Can someone help me so that only sub combobox2_change runs only when drop down list #2 is selected. Thanks --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Working with 2 drop down list
Does it help to temporarily turn off events in your cb1 action code: sub cb1_change() Application.EnableEvents=false .....your action code... Application.EnableEvents=true end sub ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ ~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Working with 2 drop down list
I've seen this example but using validation functionality constrains to the
current worksheet or external file that must be open. I couldn't get it to use a range outside of the current worksheet. I store all my picklist values on a different worksheet that's why I use the combo box list instead because it allows to select a range outside of the current worksheet. Taking this approach, Is there a way to run a sub once validation list#2 is selected? With this approach, I'dhave to create a button to call the subroutine...correct? Kim "Ken Wright" wrote in message ... Take a look here at Debra Dalgliesh's tip on dependent lists using Data Validation - This may be a mor elegant way of solving your problem.:- http://www.contextures.com/xlDataVal02.html -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 00/02/03 -------------------------------------------------------------------------- -- Newsgroups - Where you really can get a free lunch!! -------------------------------------------------------------------------- -- "Kim" wrote in message ... I have 2 drop down list on my spreadsheet. #1 is the master and #2 is based on selection from #1. For example: if a user select "Auto" in list #1, then in list #2, only a list of Auto will be filled in. My question is when I select a value in List#1 it automatically run both subs combobox1_change and combobox2_change. It doesn't allow the user the select the drop down list #2. Can someone help me so that only sub combobox2_change runs only when drop down list #2 is selected. Thanks --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Working with 2 drop down list
Kim,
Something to try (untested)... Set a Public Variable --------------------- Public StopMe as Boolean Private Sub ComboBox1_Change() StopMe = True ' code to update ComboBox2 StopMe = False End Sub Private Sub ComboBox2_Change() If StopMe = True Then Exit Sub ' combobox2 code End Sub -------------------------- John "Kim" wrote in message ... I have 2 drop down list on my spreadsheet. #1 is the master and #2 is based on selection from #1. For example: if a user select "Auto" in list #1, then in list #2, only a list of Auto will be filled in. My question is when I select a value in List#1 it automatically run both subs combobox1_change and combobox2_change. It doesn't allow the user the select the drop down list #2. Can someone help me so that only sub combobox2_change runs only when drop down list #2 is selected. Thanks |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Working with 2 drop down list
Kim
If you name the picklist range you can use it across worksheets. Also see Debra's page on running code on Change_Events. http://www.contextures.on.ca/xlDataVal08.html#Change Gord Dibben XL2002 On Sun, 30 Nov 2003 11:57:43 -0800, "Kim" wrote: I've seen this example but using validation functionality constrains to the current worksheet or external file that must be open. I couldn't get it to use a range outside of the current worksheet. I store all my picklist values on a different worksheet that's why I use the combo box list instead because it allows to select a range outside of the current worksheet. Taking this approach, Is there a way to run a sub once validation list#2 is selected? With this approach, I'dhave to create a button to call the subroutine...correct? Kim "Ken Wright" wrote in message ... Take a look here at Debra Dalgliesh's tip on dependent lists using Data Validation - This may be a mor elegant way of solving your problem.:- http://www.contextures.com/xlDataVal02.html -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 00/02/03 -------------------------------------------------------------------------- -- Newsgroups - Where you really can get a free lunch!! -------------------------------------------------------------------------- |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Working with 2 drop down list
I do exactly what you want with 3 combo boxes.
combo1 is the main and determines what goes in combo2 combo2 thencontrols what goes in combo3 Where you are going wrong is that you need to use the Click event not the change event -----Original Message----- Kim If you name the picklist range you can use it across worksheets. Also see Debra's page on running code on Change_Events. http://www.contextures.on.ca/xlDataVal08.html#Change Gord Dibben XL2002 On Sun, 30 Nov 2003 11:57:43 -0800, "Kim" wrote: I've seen this example but using validation functionality constrains to the current worksheet or external file that must be open. I couldn't get it to use a range outside of the current worksheet. I store all my picklist values on a different worksheet that's why I use the combo box list instead because it allows to select a range outside of the current worksheet. Taking this approach, Is there a way to run a sub once validation list#2 is selected? With this approach, I'dhave to create a button to call the subroutine...correct? Kim "Ken Wright" wrote in message .. . Take a look here at Debra Dalgliesh's tip on dependent lists using Data Validation - This may be a mor elegant way of solving your problem.:- http://www.contextures.com/xlDataVal02.html -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 00/02/03 ------------------------------------------------------- ------------------- -- Newsgroups - Where you really can get a free lunch!! ------------------------------------------------------- ------------------- . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003-Data Validation drop down list not working? | Excel Worksheet Functions | |||
In-Cell Drop Down List not properly working | Excel Worksheet Functions | |||
Working with Drop Down List | Excel Worksheet Functions | |||
list validation drop-down not working | Excel Discussion (Misc queries) | |||
multiple select from the drop down list in excel. list in one sheet and drop down in | Excel Discussion (Misc queries) |