Tech Support Forum banner
Status
Not open for further replies.
1 - 3 of 3 Posts

· Registered
Joined
·
2 Posts
Discussion Starter · #1 ·
Hi,

I am very new to macros, and need one that will reset several validation lists when one entry is changed.

To clarify, on worksheet 1, I have 3 validation lists in merged cells, a3:c3, d3:f3, and g3:i3.

if the value selected in a3:c3 changed, i want to blank out values in d3:f3 and g3:i3. likewise, if d3:f3 changes, i want to blank out whatever is in g3:i3, but leave the value in a3:c3 untouched.

Can anyone help? I am a complete novice in macros, so can you please let me know exactly what i need to enter in the VBA window to make this work?

Any help would be very much appreciated

Thank you

Tris
 

· Registered
Joined
·
160 Posts
Here's one method.

Right-click the sheet tab for worksheet 1, then select View Code.

In the code window for the worksheet, enter the following code:

Code:
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
    If Not (Intersect(Range("$A$3:$C$3"), Target) Is Nothing) Then
        Range("$D$3:$F$3").ClearContents
        Range("$G$3:$I$3").ClearContents
    ElseIf Not (Intersect(Range("$D$3:$F$3"), Target) Is Nothing) Then
        Range("$G$3:$I$3").ClearContents
    End If
End Sub
Modify as necessary.
 
1 - 3 of 3 Posts
Status
Not open for further replies.
Top