How to delete CommandButton and coding

Sumeluar

Active Member
Joined
Jun 21, 2006
Messages
274
Office Version
  1. 365
  2. 2016
  3. 2010
Platform
  1. Windows
  2. MacOS
  3. Mobile
Greetings!

I have a template which uses a CommandButton to get my form copied, saved and printed and in turn automatically closes everything, It works just beautifull, Only problem is that the freshly copied sheet brings with it, the coding and the CommandButton and a few other lines that I don't want them to appear because other users are to have acces to it and mishandling is occuring in the sense of altering the form and it also looks ugly.

Is there an easy way to delete all the above before the new copy is made?

Regards!

Sumeluar
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
try this suggestison


From: Erik Dillenkofer - view profile
Date: Mon, Jul 28 1997 12:00 am
Email: Erik Dillenkofer <esd...@NOSPAMgate.net>
Groups: microsoft.public.excel.programming


> RE: xlVeryHidden modules

> A macro cannot VeryHide the module in which it resides. This is a feature of Excel, apparently designed for extra protection. If a macro calls a subroutine in another module, it will also be unable to hide that module.

> The only way to very hide all the modules in a workbook is to write a
> temporary module with the code:

> Sub HideModules()
> For each m in Modules
> If m.Name <> Activesheet.Name Then m.Visible = xlVeryHidden
> Next
> End Sub

> Make sure this module is the active sheet, then run the macro and delete it. Remember to protect your workbook, otherwise users can write their own macro to unhide all of yours.


reference:
http://groups.google.com/group/micr...lnk=st&q=hide+modules&rnum=1#2fcbb678df40a02e
 
Upvote 0
Thanks venkat1926, Looking forward to give it a try.

Regards!
 
Upvote 0

Forum statistics

Threads
1,223,284
Messages
6,171,179
Members
452,388
Latest member
Lorenzo_Barry

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