Restricting access to macros

ElvisSteel

Board Regular
Joined
Mar 23, 2009
Messages
122
I have a large workbook which is mostly protected so that users cannot change it. I have also disabled all of the save/exit options to keep them in my control.
As a result I have had to create a number of small macros which allow me to unprotect everything/save the workbook etc. The problem is that these macros are visible to user via the Developer tab, so they could run them and access the sheets.
I want to put a password on these macros, so that if anyone tries to run them, they need to enter it. If I create a simple userform asking for a password, is it possible to mask the text?
Or is there a better way to restrict access to macros?

Thanks
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi
The simplest way would be to put them in a module and make them "Private"

Private Sub test()
MsgBox "Hidden"
End Sub

If you then go to "Tools/Macros" you cannot see them, but if you type in the macro name it will run.

Good luck
//Jörgen
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,639
Members
449,093
Latest member
Ahmad123098

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