Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to unprotect an excel sheet using VBA?

user-image
Question added by Majid Shafi Ahmad , Data Entry Operator (BS-12) , Punjab Food Authority
Date Posted: 2016/10/20
Firas Shahadi
by Firas Shahadi , Human Resources Director , SAUDI UNION

the stright to point method is:

worksheet.unprotect "password"

 

Anand Srivastava
by Anand Srivastava , Sr. Tech. Support Officer

press alt F11 a popup window will appear, insert a security module in the VBA code using insert menu,then copy paste the window and save it and execute it by pressing F5

Mark Anthony Valenzuela
by Mark Anthony Valenzuela , Food and Beverage(Waiter/Server) , TESDA(Technical Education and Skills Development Authority

press alt f11 insert a module using insert menu,then copy paste the window.and execute it by pressing f5

nasir iqbal
by nasir iqbal , Team Lead , SBTC

A string that denotes the case-sensitive password to use to unprotect the sheet or workbook. If the sheet or workbook isn't protected with a password, this argument is ignored. If you omit this argument for a sheet that's protected with a password, you'll be prompted for the password. If you omit this argument for a workbook that's protected with a password, the method fails.

Masood Ahmed
by Masood Ahmed , Training , Sungard (FIS)

Private Sub Unprotectsheet() 

 

 

'This code will protect "Sheet1" with the password test

 

    ActiveSheet.Unprotect Password:="test" 

    Sheets("Sheet1").Select 

    ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _ 

    False 

    ActiveSheet.Protect Password:="test" 

 

'This below code will then unprotect "sheet1" using password "test", you only 'need this bit for your question

  Sheets("Sheet1").Select 

ActiveSheet.Unprotect Password:="test"

 

'or you can use

Sheets("sheet1").Unprotect Password:="test"

 

 

 

     

End Sub 

More Questions Like This