Worksheet_Change Event - Macro kills copy and paste
Rob Bovey wrote:
Hi Alan,
The value of Application.CutCopyMode will tell you whether a user has a
cut or copy operation in progress when your event procedure fires, something
like this:
Private Sub Worksheet_Change(ByVal Target As Range)
If Application.CutCopyMode = 0 Then
''' User hasn't copied anything,
''' run your macro here.
End If
End Sub
Thanks. That is good to know. Though I haven't had any problem with the
change event and copy/pasting, I have needed to know when a copy/paste
operation happened to clear comments and to speed up some functions.
Have been using this:
' If value was pasted, delete comments.
If ((ActiveCell.Row = Target.Row) And (ActiveCell.Column =
Target.Column)) Then
Target.ClearComments
IsCopyPaste = True
End If
|