Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Use autofilter with macro in a protected sheet

Hi,

I have a protected worksheet with the option of Use Autofilter enabled.
I have a macro that runs a filter for selected records. I have a second macro
(see below) that removes the previous filter.

ActiveSheet.Unprotect
Selection.AutoFilter Field:=20
ActiveSheet.Protect

End Sub

How can I again enable the Use Autofilter together with the Active
Sheet.Protect command.

Thanks

Minos

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default Use autofilter with macro in a protected sheet

Change the last line to callout what you want to allow. The standard
protection protects drawing objects, contents, and scenarios. We'll just add
on that you want to allow filtering.

ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True _
, AllowFiltering:=True
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Minos" wrote:

Hi,

I have a protected worksheet with the option of Use Autofilter enabled.
I have a macro that runs a filter for selected records. I have a second macro
(see below) that removes the previous filter.

ActiveSheet.Unprotect
Selection.AutoFilter Field:=20
ActiveSheet.Protect

End Sub

How can I again enable the Use Autofilter together with the Active
Sheet.Protect command.

Thanks

Minos

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
using autofilter and sort, while sheet is protected mariekek5 Excel Discussion (Misc queries) 0 June 17th 09 01:13 PM
Autofilter in protected sheet Javier Excel Worksheet Functions 5 March 24th 08 05:56 PM
use macro button to run macro in protected sheet earl Excel Discussion (Misc queries) 3 February 26th 06 10:21 PM
AutoFilter 2003 Excel Protected Sheet bdehning Excel Discussion (Misc queries) 3 December 27th 05 11:51 PM
Applying autofilter to protected sheet Brian Ferris Excel Discussion (Misc queries) 2 November 18th 05 04:28 PM


All times are GMT +1. The time now is 01:46 PM.

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

About Us

"It's about Microsoft Excel"