Sub protect_all_sheets() top: pass = InputBox("password?") repass = InputBox("Verify Password") If Not (pass = repass) Then MsgBox "This is NOT the password !!!" GoTo top End If For i = 1 To Worksheets.Count If Worksheets(i).ProtectContents = True Then GoTo oops Next For Each s In ActiveWorkbook.Worksheets s.Protect Password:=pass, AllowFiltering:=True Next Exit Sub oops: MsgBox "I think you have some sheets that are already protected. Please unprotect all sheets then running this Macro." End Sub
Im using Excel MS 365 MSO (16.0.13628.20318) and have a question about a VBA code i've used.
The code is as above and I tried to search for the answer to no avail. Basically as I am typing in the password ... it can be seen (so if someone is watching while I edit then they can see the password when its typed in).
How can I code it as to not show whilst typing.
Apologies as I am only starting out with code writing ... my end goal is to "Protect all tabs" / "allow some editing" with a macro