How to delete CommandButton and coding

Sumeluar

Active Member
Joined
Jun 21, 2006
Messages
271
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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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,214,431
Messages
6,119,458
Members
448,899
Latest member
maplemeadows

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