K
Kevlar
I want to trigger a macro called "AddC" whenever I enter data into
cell and press enter.
I have the following code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Address = "$D$22" Then
AddC
End If
End Sub
the code for Addc is:
Range("W22").Select
Selection.Copy
Range("D22").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats
Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("D23").Select
End Sub
When it fires it goes into a continual loop. Why does it do this an
how do I prevent the loop
cell and press enter.
I have the following code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Address = "$D$22" Then
AddC
End If
End Sub
the code for Addc is:
Range("W22").Select
Selection.Copy
Range("D22").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats
Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("D23").Select
End Sub
When it fires it goes into a continual loop. Why does it do this an
how do I prevent the loop