Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
AT AT is offline
external usenet poster
 
Posts: 18
Default Create logical custom drop down list

I am working on building a spreadsheet which populates values in cells based
on values in previous cells. All of this is in drop down lists (data
validation list) or using a combo box.
For Example:
if I enter Automobile in A2, I want B2 to be restricted to Ford, GM, BMW,
etc.
if I enter Airline in A2, I want B2 to only show Delta, Northwest, etc.
And so on....
I also want to copy these lists through out the sheet (row 2 - row 100).
I have got to the point where I am using a combo box for the values in A2
but I can not get over the hump to restrict values in B2 to certain values
(Ford, Delta, etc.) based on what was input in A2.

Not sure if that makes sense, but can anyone help? Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Create logical custom drop down list

Hi,
You will find a full explanation with sample code here on how to
generate related lists:

http://www.xldynamic.com/source/xld.Dropdowns.html

HTH

"AT" wrote:

I am working on building a spreadsheet which populates values in cells based
on values in previous cells. All of this is in drop down lists (data
validation list) or using a combo box.
For Example:
if I enter Automobile in A2, I want B2 to be restricted to Ford, GM, BMW,
etc.
if I enter Airline in A2, I want B2 to only show Delta, Northwest, etc.
And so on....
I also want to copy these lists through out the sheet (row 2 - row 100).
I have got to the point where I am using a combo box for the values in A2
but I can not get over the hump to restrict values in B2 to certain values
(Ford, Delta, etc.) based on what was input in A2.

Not sure if that makes sense, but can anyone help? Thanks in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
AT AT is offline
external usenet poster
 
Posts: 18
Default Create logical custom drop down list

Hi Toppers:

Is there any way to use just logical If statements to do this? Also, when I
download the worksheet on the site I get run time errors with the data
validation example. The reason I ask is that this same information has to be
repeated multiple times on a data entry spreadsheet. I am not using a form,
just a manual data entry worksheet.

Any tthoughts? Thanks.

"Toppers" wrote:

Hi,
You will find a full explanation with sample code here on how to
generate related lists:

http://www.xldynamic.com/source/xld.Dropdowns.html

HTH

"AT" wrote:

I am working on building a spreadsheet which populates values in cells based
on values in previous cells. All of this is in drop down lists (data
validation list) or using a combo box.
For Example:
if I enter Automobile in A2, I want B2 to be restricted to Ford, GM, BMW,
etc.
if I enter Airline in A2, I want B2 to only show Delta, Northwest, etc.
And so on....
I also want to copy these lists through out the sheet (row 2 - row 100).
I have got to the point where I am using a combo box for the values in A2
but I can not get over the hump to restrict values in B2 to certain values
(Ford, Delta, etc.) based on what was input in A2.

Not sure if that makes sense, but can anyone help? Thanks in advance.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Create logical custom drop down list

The gist of the code is:

Capture the change event for cell A2 (worksheet module - change event)

Build a case select or If...Then...Elseif...End If.
Compare the value of A2 against a list.
A Vlookup usually works. Where column 1 of the lookup range contains the
list for Range A2
the 2 nd column contains the names of the other lists that correspond to the
values in A.
Use the result to asign the proper list name to the Data Validation in B2

(this code is just a sample and has not been tested)

dim lst1 as Sting, lst2 as String

If target.address = $A$2 then
lst1 = VLookup(target, Sheets("Tables").Range("A1:B25"),2,False)
End If

Now build code to change the Data Validation list of B2 = lst1
(you can get this code by building the Data Validation with the Recorder on)
--
steveB

Remove "AYN" from email to respond
"AT" wrote in message
...
Hi Toppers:

Is there any way to use just logical If statements to do this? Also, when
I
download the worksheet on the site I get run time errors with the data
validation example. The reason I ask is that this same information has to
be
repeated multiple times on a data entry spreadsheet. I am not using a
form,
just a manual data entry worksheet.

Any tthoughts? Thanks.

"Toppers" wrote:

Hi,
You will find a full explanation with sample code here on how to
generate related lists:

http://www.xldynamic.com/source/xld.Dropdowns.html

HTH

"AT" wrote:

I am working on building a spreadsheet which populates values in cells
based
on values in previous cells. All of this is in drop down lists (data
validation list) or using a combo box.
For Example:
if I enter Automobile in A2, I want B2 to be restricted to Ford, GM,
BMW,
etc.
if I enter Airline in A2, I want B2 to only show Delta, Northwest, etc.
And so on....
I also want to copy these lists through out the sheet (row 2 - row
100).
I have got to the point where I am using a combo box for the values in
A2
but I can not get over the hump to restrict values in B2 to certain
values
(Ford, Delta, etc.) based on what was input in A2.

Not sure if that makes sense, but can anyone help? Thanks in advance.



  #5   Report Post  
Posted to microsoft.public.excel.programming
AT AT is offline
external usenet poster
 
Posts: 18
Default Create logical custom drop down list

Hi Steve:

Thanks for your input. I am a novice at VBA and Excel so if you could break
this down a little bit for me I would appreciate it. If not, I understand.
Thanks for your time.
-AT

"STEVE BELL" wrote:

The gist of the code is:

Capture the change event for cell A2 (worksheet module - change event)

Build a case select or If...Then...Elseif...End If.
Compare the value of A2 against a list.
A Vlookup usually works. Where column 1 of the lookup range contains the
list for Range A2
the 2 nd column contains the names of the other lists that correspond to the
values in A.
Use the result to asign the proper list name to the Data Validation in B2

(this code is just a sample and has not been tested)

dim lst1 as Sting, lst2 as String

If target.address = $A$2 then
lst1 = VLookup(target, Sheets("Tables").Range("A1:B25"),2,False)
End If

Now build code to change the Data Validation list of B2 = lst1
(you can get this code by building the Data Validation with the Recorder on)
--
steveB

Remove "AYN" from email to respond
"AT" wrote in message
...
Hi Toppers:

Is there any way to use just logical If statements to do this? Also, when
I
download the worksheet on the site I get run time errors with the data
validation example. The reason I ask is that this same information has to
be
repeated multiple times on a data entry spreadsheet. I am not using a
form,
just a manual data entry worksheet.

Any tthoughts? Thanks.

"Toppers" wrote:

Hi,
You will find a full explanation with sample code here on how to
generate related lists:

http://www.xldynamic.com/source/xld.Dropdowns.html

HTH

"AT" wrote:

I am working on building a spreadsheet which populates values in cells
based
on values in previous cells. All of this is in drop down lists (data
validation list) or using a combo box.
For Example:
if I enter Automobile in A2, I want B2 to be restricted to Ford, GM,
BMW,
etc.
if I enter Airline in A2, I want B2 to only show Delta, Northwest, etc.
And so on....
I also want to copy these lists through out the sheet (row 2 - row
100).
I have got to the point where I am using a combo box for the values in
A2
but I can not get over the hump to restrict values in B2 to certain
values
(Ford, Delta, etc.) based on what was input in A2.

Not sure if that makes sense, but can anyone help? Thanks in advance.






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Create logical custom drop down list

Hi,
A further source (requires no progamming) with sample download:

http://www.contextures.com/xlDataVal02.html

I have used this technique myself.

HTH

"STEVE BELL" wrote:

The gist of the code is:

Capture the change event for cell A2 (worksheet module - change event)

Build a case select or If...Then...Elseif...End If.
Compare the value of A2 against a list.
A Vlookup usually works. Where column 1 of the lookup range contains the
list for Range A2
the 2 nd column contains the names of the other lists that correspond to the
values in A.
Use the result to asign the proper list name to the Data Validation in B2

(this code is just a sample and has not been tested)

dim lst1 as Sting, lst2 as String

If target.address = $A$2 then
lst1 = VLookup(target, Sheets("Tables").Range("A1:B25"),2,False)
End If

Now build code to change the Data Validation list of B2 = lst1
(you can get this code by building the Data Validation with the Recorder on)
--
steveB

Remove "AYN" from email to respond
"AT" wrote in message
...
Hi Toppers:

Is there any way to use just logical If statements to do this? Also, when
I
download the worksheet on the site I get run time errors with the data
validation example. The reason I ask is that this same information has to
be
repeated multiple times on a data entry spreadsheet. I am not using a
form,
just a manual data entry worksheet.

Any tthoughts? Thanks.

"Toppers" wrote:

Hi,
You will find a full explanation with sample code here on how to
generate related lists:

http://www.xldynamic.com/source/xld.Dropdowns.html

HTH

"AT" wrote:

I am working on building a spreadsheet which populates values in cells
based
on values in previous cells. All of this is in drop down lists (data
validation list) or using a combo box.
For Example:
if I enter Automobile in A2, I want B2 to be restricted to Ford, GM,
BMW,
etc.
if I enter Airline in A2, I want B2 to only show Delta, Northwest, etc.
And so on....
I also want to copy these lists through out the sheet (row 2 - row
100).
I have got to the point where I am using a combo box for the values in
A2
but I can not get over the hump to restrict values in B2 to certain
values
(Ford, Delta, etc.) based on what was input in A2.

Not sure if that makes sense, but can anyone help? Thanks in advance.




  #7   Report Post  
Posted to microsoft.public.excel.programming
AT AT is offline
external usenet poster
 
Posts: 18
Default Create logical custom drop down list

Hi Toppers,
This works great! Thanks a ton!
-AT

"Toppers" wrote:

Hi,
A further source (requires no progamming) with sample download:

http://www.contextures.com/xlDataVal02.html

I have used this technique myself.

HTH

"STEVE BELL" wrote:

The gist of the code is:

Capture the change event for cell A2 (worksheet module - change event)

Build a case select or If...Then...Elseif...End If.
Compare the value of A2 against a list.
A Vlookup usually works. Where column 1 of the lookup range contains the
list for Range A2
the 2 nd column contains the names of the other lists that correspond to the
values in A.
Use the result to asign the proper list name to the Data Validation in B2

(this code is just a sample and has not been tested)

dim lst1 as Sting, lst2 as String

If target.address = $A$2 then
lst1 = VLookup(target, Sheets("Tables").Range("A1:B25"),2,False)
End If

Now build code to change the Data Validation list of B2 = lst1
(you can get this code by building the Data Validation with the Recorder on)
--
steveB

Remove "AYN" from email to respond
"AT" wrote in message
...
Hi Toppers:

Is there any way to use just logical If statements to do this? Also, when
I
download the worksheet on the site I get run time errors with the data
validation example. The reason I ask is that this same information has to
be
repeated multiple times on a data entry spreadsheet. I am not using a
form,
just a manual data entry worksheet.

Any tthoughts? Thanks.

"Toppers" wrote:

Hi,
You will find a full explanation with sample code here on how to
generate related lists:

http://www.xldynamic.com/source/xld.Dropdowns.html

HTH

"AT" wrote:

I am working on building a spreadsheet which populates values in cells
based
on values in previous cells. All of this is in drop down lists (data
validation list) or using a combo box.
For Example:
if I enter Automobile in A2, I want B2 to be restricted to Ford, GM,
BMW,
etc.
if I enter Airline in A2, I want B2 to only show Delta, Northwest, etc.
And so on....
I also want to copy these lists through out the sheet (row 2 - row
100).
I have got to the point where I am using a combo box for the values in
A2
but I can not get over the hump to restrict values in B2 to certain
values
(Ford, Delta, etc.) based on what was input in A2.

Not sure if that makes sense, but can anyone help? Thanks in advance.




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
Ho do i create drop down list? Peter Excel Discussion (Misc queries) 1 March 30th 10 03:34 PM
Drop down lists that auto create and then filter the next drop down list [email protected] Excel Worksheet Functions 2 September 30th 07 11:53 AM
Create a list in a drop down dependent upon another dd list in exc fyrefox Excel Discussion (Misc queries) 1 August 9th 07 08:46 PM
Can I create a drop-down list that will reference other drop-down fdebelo Excel Worksheet Functions 3 January 7th 06 09:34 AM
Excel2003: Online help Customize Custom Hdr/FTR Drop down List MikeK Excel Discussion (Misc queries) 1 December 8th 05 03:15 PM


All times are GMT +1. The time now is 03:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"