Excel Macro Sheet Protect. Just like you can password protect workbooks and worksheets, you can password protect a macro in Excel from being viewed (and executed). Protecting and unprotecting sheets is a common action for an Excel user.
Just like you can password protect workbooks and worksheets, you can password protect a macro in Excel from being viewed (and executed).
It works perfectly except, in my original protection setting I allowed users to insert rows, but when the macro reprotects the sheet it stops users from doing this.
To protect and unprotect all sheets we need to run a loop that will loop through the sheets one at a time. You run the macro in the Visual Basic editor and unlock the Excel worksheet. This video shows you how to write a macro that protects all sheets in a workbook.







