Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Drop down box

It will be very appreceated if anyone can help, because I don't have a lot
of knowledge in Excel.
I was asked from my bos to build some drop down boxes.
Here is the logic:

Col A will have the drop down with values
1.Foreing
2.Pension
3.Unregulated

In Column B will be another drop down selection depending on what the user
select in col A.
If he selects in col A Foreing the drop down in col B will be FCP

KAG

Central
If he selects in col A Pension the drop down in col B will be ESOP

Stable

VEBA
If he selects in col A Unregulated the drop down in col B will change to
Charity
Common
LLC etc

Thank you for your help
--
Bob
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Drop down box

Here is some code for you that needs to be placed into the sheet (right click
on the sheet tab and select view code).

There are two validation drop down lists on this sheet. Cell A1 has the
first dropdown and it contains a list with the words "This", "That" and "The
Other" in it. (data validation list). Cell B1 has a validation list box that
changes based on the value in A1. There are 3 named ranges that I have
declared on a sheet called This, That and TheOther. They have the values that
I want to display in the drop down in Cell B1. When you chage the drop down
in A1 the lists in B1 changes...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim wks As Worksheet
Dim rng As Range

Set wks = ActiveSheet
Set rng = wks.Range("B1")

If Target.Address = "$A$1" Then
Select Case Target.Value
Case "This"
rng.Validation.Delete
rng.Validation.Add xlValidateList, , , "=This"
Case "That"
rng.Validation.Delete
rng.Validation.Add xlValidateList, , , "=That"
Case "The Other"
rng.Validation.Delete
rng.Validation.Add xlValidateList, , , "=TheOther"
Case Else
MsgBox "Error"
End Select
End If
End Sub

--
HTH...

Jim Thomlinson


"Bob" wrote:

It will be very appreceated if anyone can help, because I don't have a lot
of knowledge in Excel.
I was asked from my bos to build some drop down boxes.
Here is the logic:

Col A will have the drop down with values
1.Foreing
2.Pension
3.Unregulated

In Column B will be another drop down selection depending on what the user
select in col A.
If he selects in col A Foreing the drop down in col B will be FCP

KAG

Central
If he selects in col A Pension the drop down in col B will be ESOP

Stable

VEBA
If he selects in col A Unregulated the drop down in col B will change to
Charity
Common
LLC etc

Thank you for your help
--
Bob

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default Drop down box

Excel 2003

First cell is F5
select F5
DATA Validation
AllowList
source - A5:A7 - type in your list here
add second selections in B5:c5,B6:c6,B5:d7

Second Cell F6
Select F6
DATA Validation
AllowList
source - formula is

=IF(F5="Foreing",B5:C5,IF(F5="pension",B6:C6, IF(F5="Unregulated",B7:D7,"")))

when you mouse over the cells drop down appears with your lists.

ONE PROBLEM:
if you choose F5 then F6
and then change F5...........F6 is still set to the old setting

S0 - mark this as a problem ....

put data in this format (A10:B16) and use Vlookup in your Conditional
formating

KAG Foreing
Central Foreing
Stable Pension
VEBA Pension
Charity Unregulated
Common Unregulated
LLC etc Unregulated

select cell G5
FormatConditionalFormatting
Formula is
=IF(VLOOKUP(G5,A10:B16,2)=F5,0,1)
Formatpattern pick a nice pink color to mark that this needs changed

"Bob" wrote:

It will be very appreceated if anyone can help, because I don't have a lot
of knowledge in Excel.
I was asked from my bos to build some drop down boxes.
Here is the logic:

Col A will have the drop down with values
1.Foreing
2.Pension
3.Unregulated

In Column B will be another drop down selection depending on what the user
select in col A.
If he selects in col A Foreing the drop down in col B will be FCP

KAG

Central
If he selects in col A Pension the drop down in col B will be ESOP

Stable

VEBA
If he selects in col A Unregulated the drop down in col B will change to
Charity
Common
LLC etc

Thank you for your help
--
Bob

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
Drop Down Lists: Allow option of adding own data if not in drop do ruperthouse Excel Worksheet Functions 8 July 21st 09 07:29 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
how do I use one drop-list to modify another drop-lists options? [email protected] Excel Discussion (Misc queries) 3 September 9th 07 05:46 PM
how do I link a drop down list entry to a new drop down cell? lmunzen Excel Discussion (Misc queries) 1 August 15th 06 04:59 PM
Cross-referenced drop-down menu (nested drop-downs?) creativeops Excel Worksheet Functions 4 November 22nd 05 05:41 PM


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