View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Clean-Up Cascading Data Validation List Values

The code you posted won't run the "Then" portion of your code. The .address
will include the $ signs unless you do something different.

Option Explicit
Private Sub worksheet_change(ByVal target As Range)
If target.Address = "$A$1" Then
me.Range("A2").Value = ""
End If
End Sub

If this doesn't help, you may want to copy directly from the VBE and paste into
your followup message.

Lisa C. wrote:

I have two dependent data validation lists. The first list (in cell A1)
determines the values on the second list (in cell A2). When the value
selected in cell A1 is changed, the following code blanks out any value
already selected in cell A2. The code works when the value in cell A1 is
changed to a new value, but it doesn't work when the value in cell A1 is
deleted or blanked out. How can I fix this?

Option Explicit
Private Sub worksheet_change(ByVal target As Range)

If target.Address = "A1" Then
ActiveSheet.Range("A2").Value = ""
End If

End Sub


--

Dave Peterson