+ Reply to Thread
Results 1 to 2 of 2

Automatically enable autofilter

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-01-2012
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    112

    Automatically enable autofilter

    I need help in creating a VBA code to automatically enable AutoFilter from B7:N7 when sheet 2 is selected. Sheet 2 is protected with a password and cell B7:N7 is locked.

    Hope anyone can help me. Thanks.

  2. #2
    Forum Contributor
    Join Date
    03-12-2013
    Location
    Chicago, USA
    MS-Off Ver
    Excel 2007
    Posts
    230

    Re: Automatically enable autofilter

    I've never used a worksheet open event before, but I found this code on another website and think it may work. Enter your password for the locked cells in the quotations below that say "enterpasswordhere".
    Also, I wasn't sure how to make this macro apply to only Sheet2, so I added an IF statement to always check to see if the active sheet is Sheet2 when you open any worksheet.

    Private Sub Worksheet_Activate()
    If ActiveSheet.Name = "Sheet2" Then
    ActiveSheet.Unprotect "enterpasswordhere"
    Range("B7:N7").Select
    Selection.AutoFilter
    End If
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How Can I Enable AutoFilter on a Password-Protected Table?
    By snapfade in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-29-2013, 12:45 PM
  2. enable autofilter/ expand collapse
    By mitelkm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-22-2008, 01:53 PM
  3. How do I enable a disabled Autofilter in Excel
    By JimFraserPE in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-29-2006, 12:10 PM
  4. [SOLVED] How do I enable autofilter on a protected shared workbook?
    By Bungle in forum Excel General
    Replies: 3
    Last Post: 08-08-2005, 10:05 PM
  5. enable autofilter in a protected worksheet in Excel 97
    By WooGHeR in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-25-2005, 01:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1