Clear.Contents does not work when Password protected for sheet. Please help. Sheet's name is "Project SL Assessment Checklist".
Please Login or Register to view this content.
Clear.Contents does not work when Password protected for sheet. Please help. Sheet's name is "Project SL Assessment Checklist".
Please Login or Register to view this content.
You need to unprotect the sheet before you clear the contents, then you can re-protect if you like.
Like:
Please Login or Register to view this content.
Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.
Please,mark your thread [SOLVED] if you received your answer.
This worked fine on another sheet that was password protected with only one clear contents script. Why does adding another clear.contents line (two) require you to modify the code as such?
Perhaps the cell is unlocked on one sheet and locked on the other.
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
You can designate an area to allow edits when the sheet is protected. In general, the code can only clear or edit what the user can.
I have the appropriate cells unlocked for their editing when protected. However, I think the issue may be because some of these cells (fields for input) are merged?
How do you account for merged cells in clear contents? For example, the first "field" (H12:I12) is merged and the sheet contains various "fields" / merged cells on down to G42:J42.
I assume there is a problem with the following? All cells in the merged range are unlocked.
Please Login or Register to view this content.
Last edited by chparkervatech; 08-29-2016 at 04:49 PM.
This is where "does not work" is not good enough a description. What error do you get?
Regardless, your solution worked. Thanks!
If you protect the sheet with VBA and use the parameter UserInterfaceOnly:=True, then you can write into protected cells, too. Whether or not cells are merged does not matter.
The blue and the yellow cells in the screenshot are merged. All cells are locked.
2016-08-30_9-04-38.gif
Last edited by teylyn; 08-29-2016 at 05:05 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks