I have a macro to protect all sheets in a workbook as follow:
Sub protectsheets()
Dim wsheet As Worksheet
For Each wsheet In ActiveWorkbook.Worksheets
wsheet.Protect ("alex")
Next wsheet
End Sub
Sub unprotectsheets()
Dim wsheet As Worksheet
myPassword = InputBox("Enter Password")
While (myPassword <> "alex")
myPassword = InputBox("Enter Password")
Wend
For Each wsheet In ActiveWorkbook.Worksheets
wsheet.Unprotect (myPassword)
Next wsheet
End Sub
My question how can I allow edit object in the routine. The reason is that when sheet is protected i cannot paste picutres into the unlocked cells area, and i need that.
Thank you, your help will appreciated