My Excel sheet 13 isn't Unprotecting. Please help!

Tarali

New Member
Joined
Apr 11, 2021
Messages
8
Office Version
  1. 2010
Platform
  1. Windows
I gave the code, perhaps wronly:

sheet13.protect password = "2710"
to protect the sheet with the intent to use my password as 2710. However, I couldn't unprotect with password 2710. Please, help me. What could I do?
 

Are you sure the code is actually getting to the Unprotect line ?
Try using F8 to step through the code to see if it jumps over those lines.
I did ask that you post the code so we could have a look through it ?
Sub ShowTEST_AnalysisConditional()

Application.ScreenUpdating = False
'GROUP A ---WHEN ALL TEST REQUIRED GIVEN IN AN AP
If Sheets("Switch").Range("Q10").Value <> "" And _
Sheets("Switch").Range("S10").Value <> "" And _
Sheets("Switch").Range("U10").Value <> "" And _
Sheets("Switch").Range("W10").Value <> "" And _
Sheets("Switch").Range("Y10").Value <> "" Then

Application.ScreenUpdating = False
Sheet13.Unprotect Password = "2710"
ActiveSheet.PageSetup.PrintArea = "$A$2:$AB$47,$A$50:$AB$96,$A$98:$AB$146,$A$148:$AB$194,$A$198:$AB$244"
Sheets("Tests_Analysis").scrollarea = "$A$2:$AB$244"
'Call RectangleT3_Covered
'Call RectangleT4_Covered
'Call RectangleT5_Covered
Sheet13.Protect Password = "2710"
Application.ScreenUpdating = True

End if

End Sub
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
The code on the link you provided is slightly different.....the very first line in that code says "ElseIf" the code in post #11 doesn't.
Also, where is the original line of
VBA Code:
Sheet13.Protect Password = "2710"
The macro you provided doesn't show an initial Protect Line. and that could be where your problem lies.
Did you manually protect Sheet13 to start with ??
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,181
Members
449,071
Latest member
cdnMech

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