i know this has to be simple but....

aspiar

New Member
Joined
Oct 20, 2006
Messages
1
i cant figure it out.
I'd like to load a list based on the value of the cell above. for example:

In cell A1 you can choose Apples, Oranges or Lemons
if you choose Apples, the in cell B1 you get to choose from a list like: RED, GREEN, LARGE, SMALL etc etc

If you choose Oranges in A1 then you can choose ORANGE, JUICY, DRY etc etc in B1

And so on and so forth....

Any ideas???

Thanks!
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Macropheliac

Board Regular
Joined
Aug 26, 2005
Messages
165
Maybe this can get you started:

The following code works with validation lists. When the worksheet is selected, the choices in A1 become Apples, Oranges, or Lemons. If Apples is selected, the choices in B1 become Red, Green, Large, or Small. If Red is selected, the choices become Sweet, Sour, or Bitter.
Code:
Private Sub Worksheet_Activate()
 With Range("A1").Validation
        .Delete
        .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
        xlBetween, Formula1:="Apples,Oranges,Lemons"
    End With
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
    Case "$A$1"
        Select Case Target.Value
            Case "Apples"
                With Range("B1").Validation
                    .Delete
                    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
                    xlBetween, Formula1:="Red,Green,Large,Small"
                End With
        End Select
    Case "$B$1"
        Select Case Target.Value
            Case "Red"
                With Range("C1").Validation
                    .Delete
                    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
                    xlBetween, Formula1:="Sweet,Sour,Bitter"
                End With
        End Select
End Select
End Sub

To enter the code:
-Select the worksheet
-Right-Click the sheet tab
-Choose View Code
-Paste the code

Study the Select Case Method and modify the code as necessary. If you need any help, please post back.

Good luck,
Mac
 

Forum statistics

Threads
1,136,878
Messages
5,678,307
Members
419,754
Latest member
LordEddard

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top