Macro - Playing Macro if cells are locked

  • Thread starter Thread starter sonar
  • Start date Start date
S

sonar

Hi

I want to create a macro to hide and unhide certain columns with "F
keys.

Will it work when most of my cells are locked and password protected?

Thanks
 
Sub MyMacro()
ActiveSheet.Unprotect Password:="ABCD"
' recorded code
Activesheet.Protect Password:="ABCD"
End Sub
 

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

Back
Top