Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 634
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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
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
Excel 2003-Data Validation drop down list not working? Balcott Excel Worksheet Functions 1 September 25th 08 07:42 PM
In-Cell Drop Down List not properly working [email protected] Excel Worksheet Functions 8 April 24th 08 08:46 AM
Working with Drop Down List JP2R Excel Worksheet Functions 3 June 18th 07 07:57 PM
list validation drop-down not working Mike Excel Discussion (Misc queries) 2 April 10th 07 12:10 PM
multiple select from the drop down list in excel. list in one sheet and drop down in sriramus Excel Discussion (Misc queries) 5 October 27th 05 06:55 PM


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