Powered by Invision Power Board

Recommended Sites: - VBA Express - JMT Forums - MrExcel - Ozgrid - MS Discussion Groups - John Walkenbach - Chip Pearson - Stephen Bullens Excel Page - xlDynamic (Bob Phillips) - JKP (Jan Karel Pieterse) - The Xcel Files (Ivan F Moala) - The Excel Maniacs (Gareth) - Scriptorium (Rembo) - ExcelKB (XL-Dennis) - and don't forget to register here - it's free!...
  Reply to this topicStart new topicStart Poll

Cell Protection help, Copy and paste from locked cells
MarcL
Posted: May 25, 2009 02:16 pm
Quote Post


New Member
*

Group: Members
Posts: 1
Member No.: 252
Joined: May 25, 2009



Hi,
I have a Workbook which contains a number of Sheets, call these A, B, C and Z for the sake of simplicity.

I have a macro which does some formatting on each Sheet and then protects each sheet with the following command (replacing A_Sheet with B_Sheet, etc...):

wBookMaster.Sheets(A_Sheet).Protect _
DrawingObjects:=False, _
Contents:=True, _
Scenarios:=False, _
UserInterfaceOnly:=False, _
AllowFormattingCells:=False, _
AllowFormattingColumns:=False, _
AllowFormattingRows:=False, _
AllowInsertingColumns:=False, _
AllowInsertingRows:=False, _
AllowInsertingHyperlinks:=False, _
AllowDeletingColumns:=False, _
AllowDeletingRows:=False, _
AllowSorting:=False, _
AllowFiltering:=False, _
AllowUsingPivotTables:=False, _
Password:=Protection_PWD

The macro then protects the workbook as follows:

wBookMaster.Protect Structure:=True, Windows:=False, Password:=Protection_PWD

The question is:

On Sheets A, B & C, I have protected cells with data I do not want changed. I also have unlocked cells in some columns on these sheets.

I want to be able to copy and paste the values from the lcoked cells in either Sheet A, B or C into unlocked cells in Sheet Z. The workbook does not allow me to do this.

I can:

1. copy data from the locked cells in, say, Sheet A to an area of unlocked cells in Sheet A, same for B & C - keeping withing the same sheet

2. copy from another workbook into the unlocked cells of any sheet.

What is wrong with the protection I have implemented? I have tried a few different parameters (True / False) on the Protection statement to see if I could get this right, but cannot.

Any help will be very much appreciated!

Marc
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll