How to unprotect target xls-sheet in VBA using advanced filter?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Have a spreadsheet with advanced filter, that copies the result to another
sheet. Won't work with sheet-protection enabled. Anyone knows how to
unprotect the target sheet prior to the automated copying, and then
protecting the sheet again, to avoid user-error...?

other suggestions?
 
Maybe,

Sub protectmenot()
Worksheets("Sheet3").Unprotect Password:="mypass"
'do you stuff
Worksheets("Sheet3").Protect Password:="mypass"
End Sub

Mike
 
Perfect! Thank a lot!

BR Kjetil

Mike H said:
Maybe,

Sub protectmenot()
Worksheets("Sheet3").Unprotect Password:="mypass"
'do you stuff
Worksheets("Sheet3").Protect Password:="mypass"
End Sub

Mike
 

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