Thread
:
Hide a Macro
View Single Post
#
2
Posted to microsoft.public.excel.misc
Gord Dibben
external usenet poster
Posts: 22,906
Hide a Macro
Alt + F11 to open VBEditor.
Select your workbook.
Right-click on it and select VBAProject PropertiesProtectionLock for viewing
and give a password.
Note: you must save the file before the locking takes effect.
Gord Dibben MS Excel MVP
On Wed, 25 Jul 2007 04:46:17 -0700,
wrote:
Hi all,
I have a multiple worksheets which i wish to password protect. I have
done so using the following VBA code:
Sub ProtectAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
Sheets(n).Protect Password:="XXXX"
Next n
Application.ScreenUpdating = True
End Sub
Sub UnprotectAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
Sheets(n).Unprotect Password:="XXXX"
Next n
Application.ScreenUpdating = True
End Sub
I do not wish others to be able to view this code as it defeats the
purpose of password protecting it.
How do i hide this macro but still be able to run it at my own
expense?
Cheers,
Grant.
Reply With Quote
Gord Dibben
View Public Profile
Find all posts by Gord Dibben