Forum Discussion
PROTECTING CELLS BUT ALLOW COPYING OF ROWS
visit these sites:
https://support.office.com/en-us/article/copy-and-paste-in-a-protected-worksheet-139e676e-10a0-443b-bbfe-3dac22cd8476
https://www.extendoffice.com/documents/excel/4129-excel-protect-sheet-allow-copy.html
another way is in Workbook_open sub - unprotect the sheet
then in Workbook_BeforeClose sub - protect the sheet
HTH
Hi Lorenzo
Does this mean you still need to enter the password to allow the unprotect? As I don't want to allow users to do this.
- Lorenzo KimOct 05, 2018Bronze Contributor
I am not an expert on this, but I'd use this method in my work.
try this first on a test file. Always make a backup of your work.
if this work after several tests, then give it a go.
press ALT F11
and in ThisWorkbook module
place the codes below
Private Sub Workbook_Open() 'change your password to suit
Sheet1.UnProtect Password:="your password", UserInterFaceOnly:=True 'assuming that Sheet1
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheet1.Protect Password:="your password", UserInterFaceOnly:=True
End Sub- Pam LaidlerOct 05, 2018Copper ContributorI'll try that - thank you.
I tried the name box method but that didn't work.- Lorenzo KimOct 05, 2018Bronze ContributorI think in the workbook open you should add a prompt for password ....
- Lorenzo KimOct 05, 2018Bronze Contributor
the set back for this is it will always be unprotected when opened...
rendering the protection rather useless
- Pam LaidlerOct 05, 2018Copper ContributorOh!- that won't work then, as I need to protect the formulas at all times, but just allow for copying a row and inserting it, within the same worksheet.