L
Lisa C.
I currently have the following code tied to a worksheet. The target cell
(L3) and the dependent cells that I cleanup when the value of L3 is changed
are all on the same worksheet. I now need to modify the code because I need
to move the target field to a different worksheet but still have the
dependent cells stay on the current worksheet. The name of the worksheet is
'Enter Account' and the new target cell is cell H10. Also, do I leave the
code tied to the same current worksheet or should I move it to the new
worksheet with the target cell or to a module?
Option Explicit
Private Sub worksheet_change(ByVal target As Range)
If Intersect(target, Me.Range("$L$3")) Is Nothing Then
'do nothing
Else
'clean up cascading drop-downs if first value is changed
Me.Range("H18:W18").Value = ""
Me.Range("H19:W19").Value = ""
Me.Range("H20:W20").Value = ""
Me.Range("H21:W21").Value = ""
Me.Range("AL18:AL21").Value = ""
End If
End Sub
(L3) and the dependent cells that I cleanup when the value of L3 is changed
are all on the same worksheet. I now need to modify the code because I need
to move the target field to a different worksheet but still have the
dependent cells stay on the current worksheet. The name of the worksheet is
'Enter Account' and the new target cell is cell H10. Also, do I leave the
code tied to the same current worksheet or should I move it to the new
worksheet with the target cell or to a module?
Option Explicit
Private Sub worksheet_change(ByVal target As Range)
If Intersect(target, Me.Range("$L$3")) Is Nothing Then
'do nothing
Else
'clean up cascading drop-downs if first value is changed
Me.Range("H18:W18").Value = ""
Me.Range("H19:W19").Value = ""
Me.Range("H20:W20").Value = ""
Me.Range("H21:W21").Value = ""
Me.Range("AL18:AL21").Value = ""
End If
End Sub