Disabling CTRL R or CTRL D in workbook

G

Guest

I suspect I'd do this in the Workbook_Open event, but am not sure how. Can
someone assist?

Thanks
 
J

Jim Rech

Use OnKey to assign a 'null' sub to a keystroke to kill it:

Application.OnKey "^d", ""

--
Jim
|I suspect I'd do this in the Workbook_Open event, but am not sure how.
Can
| someone assist?
|
| Thanks
 
J

Jim Rech

Well, I'd do it wherever it made sense depending on when I wanted it to take
effect. The Workbook_Open event would be the place if I wanted it to take
place immediately on opening the workbook. The effect of an OnKey is
Excel-wide though so if the user switched to another workbook Ctrl-d will be
dead there too. That is, unless you use other events like
Workbook_Deactivate to turn it off (and Workbook_Activate to set it back
on). It can get messy.

--
Jim
| Would you do this on Worksheet Open?
|
| "Jim Rech" wrote:
|
| > Use OnKey to assign a 'null' sub to a keystroke to kill it:
| >
| > Application.OnKey "^d", ""
| >
| > --
| > Jim
message
| > | > |I suspect I'd do this in the Workbook_Open event, but am not sure how.
| > Can
| > | someone assist?
| > |
| > | Thanks
| >
| >
| >
 

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