Hi,
It doesn't appear the code you posted unprotects Sheet1. Before you run anything on Sheet1, it would need to be unprotected and then you can protect it again after the code has run. The code below is how VBA is used to protect/unprotect a password protected sheet. If the sheet doesn't have a password, just drop the "Password" part:
Hope that provides some guidance,![]()
Sheets(1).Unprotect Password:="password"
Dan
Bookmarks