General discussion

Locked

Maintain a write protect if copy a WB

By merav_eiran ·
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

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Maintain a write protect if copy a WB

by merav_eiran In reply to Maintain a write protect ...

Point value changed by question poster.

Collapse -

Maintain a write protect if copy a WB

by bishopca In reply to Maintain a write protect ...

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!

Collapse -

Maintain a write protect if copy a WB

by merav_eiran In reply to Maintain a write protect ...

Poster rated this answer

Collapse -

Maintain a write protect if copy a WB

by merav_eiran In reply to Maintain a write protect ...

This question was closed by the author

Back to Software Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums