Forum Discussion
PROTECTING CELLS BUT ALLOW COPYING OF ROWS
Hi Gurus
I have a spreadsheet where I have protected the sheet with password, said to allow select locked and also insert rows, but I want users to be able to copy rows and then insert with the formulas being copied but also stay protected. Is this possible?
thanks
Pam
- Lorenzo KimBronze Contributor
visit these sites:
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 sheetHTH
- Pam LaidlerCopper Contributor
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 KimBronze 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 LaidlerCopper Contributor
Thanks Lorenzo - I've already looked at the first link - so I'll have a look at the second. P