R
RASelkirk
Hello,
I'm trying to copy some cells (using VBA) that are protected. Actually
the entire sheet with the exception of one column "Q" (for data entry
is protected. From the "Copy" button, here is my code:
Private Sub CommandCopy_Click()
ActiveWorkbook.Sheets("Codes").Unprotect (password)
Worksheets("Codes").Range("B2:N11").Select
Worksheets("Codes").Range("B2:N11").Copy
' ActiveWorkbook.Sheets("Codes").Protect (password)
End Sub
This works great if the last line (protect) is commented out. However
that leaves the sheet un-protected. If I uncomment the last line, th
clipboard somehow becomes erased. Is there any way to make this work?
Thanks!
Rus
I'm trying to copy some cells (using VBA) that are protected. Actually
the entire sheet with the exception of one column "Q" (for data entry
is protected. From the "Copy" button, here is my code:
Private Sub CommandCopy_Click()
ActiveWorkbook.Sheets("Codes").Unprotect (password)
Worksheets("Codes").Range("B2:N11").Select
Worksheets("Codes").Range("B2:N11").Copy
' ActiveWorkbook.Sheets("Codes").Protect (password)
End Sub
This works great if the last line (protect) is commented out. However
that leaves the sheet un-protected. If I uncomment the last line, th
clipboard somehow becomes erased. Is there any way to make this work?
Thanks!
Rus