I am trying to use a paste special that works when an input in my spreadsheet is changed, but for some reason I get into an iterative loop and then crash excel. Can someone tell me why this code doesn't work? And possibly offer suggestions.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Set KeyCells = Range("c7:c17")
If Not Application.Intersect(KeyCells, Range(KeyCells.Address)) _
Is Nothing Then
Range("H36").Select
Selection.Copy
Range("C26").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("F26").Select
Application.CutCopyMode = False
MsgBox ("it worked")
End If
End Sub
Bookmarks