Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Trap CTRL+C keypress event

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Trap CTRL+C keypress event

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

--
Jim Rech
Excel MVP


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Trap CTRL+C keypress event

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!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Trap CTRL+C keypress event

hasan Nazeer wrote:

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,
--
Beto
Reply: Erase between the dot (inclusive) and the @.
Responder: Borra la frase obvia y el punto previo.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Trap CTRL+C keypress event

Thx, I placed the code in Auto_Open macro and it is working.




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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trap show toolbar event [email protected] Links and Linking in Excel 0 April 27th 07 04:16 PM
how can I trap the change event (Tab Press key) of these controls Padam Excel Worksheet Functions 1 August 10th 06 03:59 PM
how can I trap the change event (Tab Press key) of these controls Padam Excel Worksheet Functions 0 August 10th 06 02:41 PM
how to trap a event coming from a dll E.Anderegg Excel Programming 6 October 16th 03 01:53 PM
KeyPress Event Conrado Capistrano Excel Programming 4 September 25th 03 05:27 AM


All times are GMT +1. The time now is 08:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"