2 ways.
1 - Change the protection to allow macros to modify the sheet. This requires
the addition of a parameter to the protection
Sheets("Sheet1").Protect UserInterfaceOnly:=true
2 - Unprotect the sheet. Run your code. Reprotect the sheet
Sheets("Sheet1").UnProtect Password:="Whatever"
'Your code here
Sheets("Sheet1").Protect Password:="Whatever"