control form macros and protected sheets

G

Guest

I have a large worksheet that requires data entry by other users. There are
both locked and unlocked cells within the worksheet. The database contains
several control form macros that cannot run if the sheet is protected.
Portions of the worksheet require sheet protection to prevent changes. Is
there a way to protect the worksheet and still run the macros?
 
J

Jim Cone

Place new code in the macros to unprotect the sheet, run the existing
code then protect the sheet.

Sub ControlFormMacro
Worksheets("LargeWorksheet").Unprotect "password"
'code to do stuff
Worksheets("LargeWorksheet").Protect "password"
End Sub
----------
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Greyson" <[email protected]>
wrote in message
I have a large worksheet that requires data entry by other users. There are
both locked and unlocked cells within the worksheet. The database contains
several control form macros that cannot run if the sheet is protected.
Portions of the worksheet require sheet protection to prevent changes. Is
there a way to protect the worksheet and still run the macros?
 

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