Trap CTRL+C keypress event

N

Nick

Is there a way to trap the CTRL+C (Window's copy event) in
Excel 2000. I want to know when a user press the CTRL+C,
what is the cell(s) address or range.
 
J

Jim Rech

You use OnKey to attach a macro to a key press (supplanting the default
behavior).

So..

Sub TrapCtrlC()
Application.OnKey "^c", "MyCopyMacro"
End Sub

Sub MyCopyMacro()
'Your code here
End Sub
 
H

hasan Nazeer

I tried placing the code, and press CTRL+C, the event did not fire. Do I
need to do anything else besides placing the code?



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
B

Beto

hasan said:
I tried placing the code, and press CTRL+C, the event did not fire. Do I
need to do anything else besides placing the code?

You need to execute it once.

Regards,
 
Top