ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   UnlockProtectedCells (https://www.excelbanter.com/excel-programming/294377-unlockprotectedcells.html)

mike

UnlockProtectedCells
 
I have a question that I hope that someone can help me with
I have a spreadsheet A that is locked except for cells A1:A10
Cells A1:A10 are data entry cells

I have a spreadsheet B that is protected

I would like to write a macro that copies the values of Cells A1:10 from speadsheet A, unlock speadsheet B, an
then copy the value of cells A1:A10 into cells A1:A10 spreadsheet B
Then I would like to relock Spreadsheet B
I do not know if this is possible, but I would appreciate any help that someone could give. thanks

Greg Koppel

UnlockProtectedCells
 
Sheets("B").Activate
ActiveSheet.Unprotect password:="password"
Sheets("A").Activate
Range("A1:A10").Copy
Sheets("B").Select
Range("A65536").End(xlUp).Offset(1,0).Select
ActiveSheet.Paste

HTH, Greg

"Mike" wrote in message
...
I have a question that I hope that someone can help me with.
I have a spreadsheet A that is locked except for cells A1:A10.
Cells A1:A10 are data entry cells.

I have a spreadsheet B that is protected.

I would like to write a macro that copies the values of Cells A1:10 from

speadsheet A, unlock speadsheet B, and
then copy the value of cells A1:A10 into cells A1:A10 spreadsheet B.
Then I would like to relock Spreadsheet B.
I do not know if this is possible, but I would appreciate any help that

someone could give. thanks



mike

UnlockProtectedCells
 
Gre
Thanks for the help
Mik



All times are GMT +1. The time now is 09:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com