ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Drop down box (https://www.excelbanter.com/excel-programming/340969-drop-down-box.html)

Bob[_67_]

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

Jim Thomlinson[_4_]

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


Vacation's Over

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



All times are GMT +1. The time now is 06:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com