I inherited a file that uses a password protect/unprotect macro tied to a button that hides rows. I'd like to remove the password but keep the hidden rows functionality but can't figure out how to do so. Here's the code as written: Application.ScreenUpdating = False
Range("L11").Select
Sheets("Inputs").Activate
ActiveSheet.Unprotect Password:="todd"
For Each cell In Range("b10:b200")
If cell.Value = 1 Then cell.EntireRow.Hidden = True
Next cell
Range("A1").Activate
ActiveSheet.Protect Password:="todd"
Sheets("Land Inv").Activate
ActiveSheet.Unprotect Password:="todd"
For Each cell In Range("A10:A200")
If cell.Value = 1 Then cell.EntireRow.Hidden = True
Next cell
Protect / Unprotect Removal VBA
-
-
-
Re: Protect / Unprotect Removal VBA
If you want to simply remove the specific password:
Remove everything after password in the code...
So
BecomesEtc...
This should remove the specific password while allowing you to lock/unlock the sheet by clicking the protect worksheet button.
If, more specifically, you want to remove the need to have the sheet protected/unprotected, I will defer to someone else's expertise... I think it would be more complex than simply removing those lines of code that contain password, but you could give it a shot...
Hope this helps...
-
Re: Protect / Unprotect Removal VBA
Not quite what I'm looking for but thanks for the reply. I want to remove the entire piece of protect/unprotect, as if it doesn't exist at all, like a normal worksheet/workbook.
-
Re: Protect / Unprotect Removal VBA
Can you post the workbook? That would help get a more specific answer.
Thanks. -
Re: Protect / Unprotect Removal VBA
Can you also read the Forum Rules & edit your post with Code tags
-
Re: Protect / Unprotect Removal VBA
Figured I could edit my reply with code tags from earlier then too...
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!