Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro that will copy one worksheet to a new one. My user wants
parts of the first worksheet protected (locked cells). When I try to run the macro, it returns an error due to the protection. How do I write code to unprotect the current worksheet so I can create a new one - and not have the user enter the password?? Karen..... |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can not copy a sheet in code that is protected (the same as you can not
copy it witout using code and just doing it manually). Why not unprotect it, copy it and reprotect it? -- HTH... Jim Thomlinson "Karen" wrote: I have a macro that will copy one worksheet to a new one. My user wants parts of the first worksheet protected (locked cells). When I try to run the macro, it returns an error due to the protection. How do I write code to unprotect the current worksheet so I can create a new one - and not have the user enter the password?? Karen..... |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jin~ That is what I am trying to do within VBA code. I am struggling with
the protect, unprotect, and password codes needed to do this. Any ideas? "Jim Thomlinson" wrote: You can not copy a sheet in code that is protected (the same as you can not copy it witout using code and just doing it manually). Why not unprotect it, copy it and reprotect it? -- HTH... Jim Thomlinson "Karen" wrote: I have a macro that will copy one worksheet to a new one. My user wants parts of the first worksheet protected (locked cells). When I try to run the macro, it returns an error due to the protection. How do I write code to unprotect the current worksheet so I can create a new one - and not have the user enter the password?? Karen..... |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
worksheets("sheet1").unprotect password:="hi"
'do the copy worksheets("sheet1").protect password:="hi" If you rightclick on the worksheet tab, you can Move or copy to a new location (even a different workbook). This kind of copying will keep the sheet protection. Karen wrote: I have a macro that will copy one worksheet to a new one. My user wants parts of the first worksheet protected (locked cells). When I try to run the macro, it returns an error due to the protection. How do I write code to unprotect the current worksheet so I can create a new one - and not have the user enter the password?? Karen..... -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying cells in a protected worksheet | Excel Worksheet Functions | |||
Password protected workbook crashes copying worksheet | Excel Discussion (Misc queries) | |||
Edit text format in non-protected cells in protected worksheet | Excel Discussion (Misc queries) | |||
Copying visible cells only on a protected worksheet | Excel Discussion (Misc queries) | |||
Copying a worksheet witrh protected cells to a new worksheet | Excel Worksheet Functions |