2 Vba Routines - stop working
I have 2 VBA routines. 1 is assigned to a button to clear cells the user has placed values in at the sheet level. The 2nd is to copy cells to other cells based on a drop down menus selection is in a macro.
I am having the following issues:
- After the 1st time the clear cells button is clicked, the cells stop copying (macro1)
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
' Check to see if cell G3 updated
If Target.Address = Range("G3").Address Then
If Target.Value = "YES" Then
Application.EnableEvents = False
Range("E9:E12").Value = Range("J3:J6").Value
Application.EnableEvents = True
Else
If Target.Address = Range("G3").Address Then
If Target.Value = "NO" Then
Application.EnableEvents = False
Range("E9:E12").ClearContents
Application.EnableEvents = True
End If
End If
End If
End If
End Sub
Code:
Sub Clearselected()
Range("e3").ClearContents
Range("e9", "e12").ClearContents
Range("H9", "H12").ClearContents
Range("i3", "i6").ClearContents
Range("K9", "K12").ClearContents
End Sub