REAL-TIME

VBA Projects

Full Access with Source Code
  • Designed and Developed by PNRao

  • Full Access with VBA Source Code

  • Well Commented Codes Lines

  • Creative and Professional Design

Effortlessly
Manage Your Projects

120+ Project Management Templates

Seamlessly manage your projects with our powerful & multi-purpose templates for project management.

120+ PM Templates Includes:
  • 50+ Excel Templates

  • 50+ PowerPoint Templates

  • 25+ Word Templates

Share Post

Unprotect Worksheet method in VBA is used to remove protection from the worksheet. If you forgot the password, you cannot unprotect the worksheet. Always better to note down in safe place. We need to Unprotect Worksheet at the beginning of the procedure to do any changes to the Worksheet.

VBA Unprotect Method Excel Worksheet Object

When we use Unprotect Worksheet Method in VBA?

Unprotect method of Worksheet object has no effect if the Worksheet is not protected. It removes protection from the Worksheet. We have to use unprotect method of worksheet object to remove password protection from the worksheet. If you forgot the password, you cannot unprotect the Worksheet.

VBA Unprotect Worksheet Method – Syntax

Here is the syntax to Unprotect Worksheet using VBA.

Worksheets(“Your Worksheet Name”).Unprotect(

[Password])

Where Password is an Optional parameter. It specifies a case sensitive password to unprotect the Worksheet. If worksheet is not protected with password then you can ignore this parameter.
In the above syntax we are using ‘Unprotect’ method of Worksheet object to unprotect the Worksheet.

VBA Protect Worksheet Method – Without Password: Example1

Please find the below example, It will show you how to unprotect the Worksheet without password.

Sub Unprotect_WorkSheet_Without_Password()
    Sheets("Sheet1").Unprotect
End Sub

Explanation: In the above example we are unprotecting the Worksheet without password by using ‘Unprotect’ method of Worksheet object in the worksheet named ‘Sheet1’. When we are unprotecting the same worksheet it won’t ask any password to unprotect the worksheet.

VBA Protect Worksheet Method – With Password: Example2

Here is the example to Unprotect the Worksheet with password.

Sub Unprotect_WorkSheet_With_Password()
    Sheets("Sheet1").Unprotect "YourPassword"
End Sub

Explanation: In the above example we are unprotecting the Worksheet with password by using ‘Unprotect’ method of Worksheet object in the worksheet named ‘Sheet1’. When working with macro or code has password protected, if you want to do any changes in the code first you have to unprotect the password at the beginning of the procedure and at the end of the procedure you have to protect it again. While unprotecting same worksheet it will ask for the password to unprotect the worksheet.

VBA Unprotect Worksheet Method- Instructions

Please follow the below step by step instructions to execute the above mentioned VBA macros or codes:

  1. Open an Excel Worksheet
  2. Press Alt+F11 :This will Open the VBA Editor. Otherwise, you can open it from the Developer Tab
  3. Insert a Module from Insert Menu
  4. Copy the above code for activating worksheet and Paste in the code window(VBA Editor)
  5. Save the file as macro enabled Worksheet
  6. Press ‘F5’ to run it or Keep Pressing ‘F8’ to debug the code line by line and check how the Worksheet has Unprotected.
Effortlessly Manage Your Projects and Resources
120+ Professional Project Management Templates!

A Powerful & Multi-purpose Templates for project management. Now seamlessly manage your projects, tasks, meetings, presentations, teams, customers, stakeholders and time. This page describes all the amazing new features and options that come with our premium templates.

Save Up to 85% LIMITED TIME OFFER
Project Management Templates

All-in-One Pack
120+ Project Management Templates

Essential Pack
50+ PM Templates

Excel Pack
50+ Excel PM Templates

PowerPoint Pack
50+ Excel PM Templates

MS Word Pack
25+ Word PM Templates

Ultimate Project
Management Template
Ultimate Resource
Management Template
Project Portfolio
Management Templates
Last Updated: March 2, 2023

One Comment

  1. Mike September 14, 2020 at 6:21 AM

    Very helpful. Thanks

Leave A Comment