Maintain a write protect if copy a WB
Hi,
Do you have a VBA code or another way that will help me to keep the cells in a worksheet write protected, even after copying it to another worksheet using copy/cut and paste.
Thanks
Software
Hi,
Do you have a VBA code or another way that will help me to keep the cells in a worksheet write protected, even after copying it to another worksheet using copy/cut and paste.
Thanks
by merav_eiran
by bishopca
I think you are asking how to save steps when you copy and paste cells. If that is the case, you should be able to develop a macro to do that.
It would probably look something like this:
Sub CopyProtect()
'Save Name of Worksheet
DimVarSH
VarSH = ActiveSheet.Name
'Unprotect the existing sheet
ActiveSheet.Unprotect
'Copy the area that user already selected
Selection.Copy
'Add a new sheet
Sheets.Add
'Use ActiveWorkbook.Worksheets("WorksheetName").paste If you do not want a new one
ActiveSheet.Paste
Selection.Locked = True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
'Restore Protection to original worksheet
ActiveWorkbook.Worksheets(VarSH).Protect
End Sub
Without knowing more specifics about what you want I am afraid that I can only get you started toward the answer - GOOD LUCK!
by merav_eiran
by merav_eiran
This discussion is closed to new replies.
Sort by Trending