View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default dependant lists- trigger a blank when 1st one is changed?

You can do this with an event macro.

Assume the primary drop down list is in cell A2 and the dependent list is in
B2.

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
On Error GoTo sub_exit
If Target.Address = "$A$2" Then
Range("B2").ClearContents
End If
sub_exit:
Application.EnableEvents = True
End Sub

To use this:
Select the sheet where you want this to happen
Right click the sheet tab and select View code
Copy/paste the code above into the window that opens
Close the window to return to Excel

--
Biff
Microsoft Excel MVP


"Roady" wrote in message
...
Hello:
I currently have two columns:
Column A is Countries
Column B is Cities associated with those countries in Column A

I have the data validation set up so that when you select Australia, for
example, in Column A, it limits/narrows the drop down list in Column B to
only show choices of cities in Australia (Sydney, Brisbane, etc.).

Here's my problem: when I have already selected the Country and city
(Australia and Sydney for example) and then later decide to change the
Country choice, it still shows the old city that I chose for Australia.
So, I
may change the country to Japan, but it will still show Sydney in Column B
unless I click on the Column B drop down.

In order to avoid careless mistakes, I would like to have it automatically
trigger the Column B to go blank if Column A is changed. Thus prompting
the
person to know that they have to fill a choice in for city from the Column
B
drop down.
Is this possible?

Much thanks!!
JR