protecting a sheet in a different workbook

D

Dan Winterton

I have a protected worksheet that VBA unprotects, copies
the sheet, opens a new workbook, then pastes the data from
the sheet.

I need to re-protect the original workbook AFTER I am in
the new book? Can I protect a worksheet in another open
workbook?

I tried protecting the sheet before opening the new book,
but I lose the data I am trying to copy and the paste
event fails. I also tried just leaving the sheet
protected during the copy and paste, but it will not allow
the formulas to copy over, which I need.

Any help is greatly appreciated.
Dan Winterton
 
D

Don Guillett

why not open the new dest wb first>open the source>unprotect>copy to dest wb
WITHOUT selecting>protect source>close source>save destination.
 
T

Tom Ogilvy

Why not just copy the sheet

Activesheet.copy

put a copy of the activesheet in a new workbook. Both sheets were protected
after the copy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top