Wanted: macro to toggle a macro on & off

Monsignor

Board Regular
Joined
May 30, 2011
Messages
162
I'm using code that disables Cut-Copy-Paste.

It works beautifully. Problem: I can't do any development with it enabled.

How can I toggle it off and on? I'm thinking about a button that's attached to a macro. Or it there a simpler way?

Thanks all!!!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
All you need to do is run the following code either attached to a command button, or via the Immediate window:
Code:
call ToggleCutCopyAndPaste(True)
 
Upvote 0
All you need to do is run the following code either attached to a command button, or via the Immediate window:
Code:
call ToggleCutCopyAndPaste(True)

AWESOME! This turned the macro off.
How do I turn the macro back on after I've made my edits and turn the spreadsheet back over to the user?
 
Upvote 0
Ok!!!! Figured it out. A second button assigned to:

Code:
call ToggleCutCopyAndPaste(False)


Thanks so much!!!!
 
Upvote 0
This macro has started disrupting my other spreadsheets.

Whenever this spreadsheet that has this macro in it is closed, none of my other spreadsheets have CUT-COPY-PASTE capability.

I go in and see: Call ToggleCutCopyAndPaste(False)
I manually change it to (True) and then hit the Run icon. My capabilities are all returned.

When I close the spreadsheet, I'm asked if I want to save. I say Yes and Excel crashes.

Any ideas what's going on? How can I properly uninstall this code?
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top