Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I have an inventory spreadsheet for which Im responsible for entering data but Im placing a COPY on the network for two managers to view as they need to keep an eye on quantities. The COPY on the network is protected (the worksheets and the workbook) and only allows them to autofilter data (per my post Autofilter, protected worksheet, Debra Dalgleishs code of today). Since Im updating the workbook every week or two, I dont want to have to update my version, make a copy, add in the code for protection and autofiltering, then place that copy on the network. I would like it if somehow I could enter the data into the protected worksheet without having to unprotect each worksheet first. Ideally, I would like it if somehow the software would recognize it is me and unprotect everything then reinforce protection when I am done updating. Is this possible? I searched the Excel forum and found a post on 10/4/06 in response by JE McGimsey <http://tinyurl.com/46jtvo to a post named Worksheet protection in which he gives the following code. Public Sub UnProtectAll() Const sPWORD As String = "myPW" Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets ws.Unprotect sPWORD Next ws End Sub The code worked for the original poster. When I compile the code (which I placed in ThisWorkbook), I dont get an error but it does not seem that this code works for me in that nothing happens when I close the file then reopen. Im not permitted to modify anything unless I unprotect the worksheet. When Im viewing the code and Run Sub/User Form I get Run-time error 1004 Application-defined or object-defined error. What am I missing? Thanks for any and all help! Chris |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
getting ride of #n/a result from vlookup | Excel Worksheet Functions | |||
Need to add same value to every cell...Is that doable? | Excel Discussion (Misc queries) | |||
How doable Using Excel? | Excel Programming | |||
Is this doable using excel? | Excel Programming | |||
Is this doable using Excel? | Excel Programming |