catch event

N

Nader Tewelde

Hello,

Is it possible to catch the event paste ?

I'd like to inform the user when is doing a copy & paste that some data
needs to be changed once the paste is done.

Thanks in advance.

Nader
 
H

Héctor Miguel

hi, Nader !
Is it possible to catch the event paste ?
I'd like to inform the user when is doing a copy & paste
that some data needs to be changed once the paste is done.

i think you could start with the following workaround and adapt to meet your conditions:

[ThisWorkbook code module]

Dim Possible_Paste As Boolean
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Possible_Paste = Application.CutCopyMode = xlCopy
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Possible_Paste = Application.CutCopyMode = xlCopy
End Sub
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Possible_Paste Then
MsgBox "You have modified cell(s) that seems to come from a Paste-operation ..."
End If
End Sub

hth,
hector.
 
N

Nader Tewelde

Thanks Hector.

Héctor Miguel said:
hi, Nader !
Is it possible to catch the event paste ?
I'd like to inform the user when is doing a copy & paste
that some data needs to be changed once the paste is done.

i think you could start with the following workaround and adapt to meet
your conditions:

[ThisWorkbook code module]

Dim Possible_Paste As Boolean
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Possible_Paste = Application.CutCopyMode = xlCopy
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
Possible_Paste = Application.CutCopyMode = xlCopy
End Sub
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
If Possible_Paste Then
MsgBox "You have modified cell(s) that seems to come from a
Paste-operation ..."
End If
End Sub

hth,
hector.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top