Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default How to unprotect target xls-sheet in VBA using advanced filter?

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default How to unprotect target xls-sheet in VBA using advanced filter?

Maybe,

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

Mike

"Kjetil" wrote:

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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default How to unprotect target xls-sheet in VBA using advanced filter

Perfect! Thank a lot!

BR Kjetil

"Mike H" wrote:

Maybe,

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

Mike

"Kjetil" wrote:

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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Advanced filter to another sheet goayimm Excel Discussion (Misc queries) 1 June 5th 08 03:30 AM
Help wanted for Advanced filter/sheet protection Kathrine Excel Worksheet Functions 0 March 28th 07 12:59 AM
Using Advanced Filter w/o having to set focus on the sheet Chris Excel Programming 0 August 6th 06 12:50 AM
Advanced Filter vs. Macro for deleting dup rows in sheet Kermit Piper Excel Programming 2 June 18th 06 11:04 AM
Advanced Filter to another sheet Rishi Dhupar Excel Programming 1 February 8th 06 07:29 PM


All times are GMT +1. The time now is 06:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"