I'm using this code to allow to make changes to a protected sheet with a VBA code:
Every time I close my excel file and return to it, I always have to run this code manually before inputting any data in my spreadsheet. If I don't I get a Run-time error '1004'.
Any help would be appeciated.
VBA Code:
Sub AllowVBAChangesOnProtectedSheet()
'Enable changes to worksheet by VBA code, even if protected
Sheets("Sheet1").Protect Password:="myPassword", _
UserInterfaceOnly:=True
End Sub
Every time I close my excel file and return to it, I always have to run this code manually before inputting any data in my spreadsheet. If I don't I get a Run-time error '1004'.
Any help would be appeciated.
Attachments
Last edited by a moderator: