The code used would depend on what you're using.
If you're using Data|Validation, a combobox from the Control toolbox toolbar or
a dropdown from the Forms toolbar, then the code would be different.
If you used Data|Validation, you could use a worksheet event (depending on the
version of excel that you have to support) to clear the contents of the cells
that are "down the chain" from that cell.
This looks at changes in A1
1.
If the change is made in A1, then B1
1 is cleared.
If the change is made in B1, then C1
1 is cleared.
If the change is made in C1, then D1 is cleared.
Since this is a worksheet event, the code is placed in the worksheet module that
should have this behavior.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then
Exit Sub 'single cell at a time
End If
On Error GoTo ErrHandler:
With Target
If Not (Intersect(.Cells, Me.Range("A1")) Is Nothing) Then
'change in A1, clear B1
1 (say)
Application.EnableEvents = False
Me.Range("b1
1").ClearContents
ElseIf Not (Intersect(.Cells, Me.Range("b1")) Is Nothing) Then
'change in b1, clear c1
1 (say)
Application.EnableEvents = False
Me.Range("c1
1").ClearContents
ElseIf Not (Intersect(.Cells, Me.Range("c1")) Is Nothing) Then
'change in c1, clear D1 (say)
Application.EnableEvents = False
Me.Range("D1").ClearContents
Else
'do nothing
End If
End With
ErrHandler:
On Error Resume Next
Application.EnableEvents = True
End Sub
.
Dave, thanks, we seem to be going down the right path.