[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

Can I use "Clear Sheet" macro on protected cells?

I have an inspection sheet where you check the boxes, print and save ~~  I need the sheet protected so the format can't be altered.    I have a "clear sheet" macro that works great until I protect the sheet ~~  Can I put the password in the macro to allow it to clear??  Thanks
1 Solution
Rory ArchibaldCommented:
const strPassword as string = "my password"
ActiveSheet.Unprotect password:=strpassword
' rest of your code here
ActiveSheet.protect password:=strpassword

Open in new window

for example.
SRMoxyAuthor Commented:
Thanks a bunch!

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now