View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Carl Carl is offline
external usenet poster
 
Posts: 361
Default Is there a way to run a procedure before the paste command?

I need to have a pop-up msg come up when someone tries to paste into a cell.
Is there a way to do this? I know how to create the pop-up, I just need to
know how to create the code to run when an attempt to paste is executed. I
created the following but the user has to double-click the cell and this is
not practical:

Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Excel.Range, Cancel As Boolean)
With Target
If Application.CutCopyMode = False Then
Cancel = True
Else
Application.Run "PasteWarning"
End If
End With
End Sub

Thanks in advance, Carl