Solved

VBA Code which allows auto filter and sort in a protected sheet

Posted on 2011-09-02
2
467 Views
Last Modified: 2012-05-12
Hi Experts,
I found the following code but it is for Excel 2000 and does not work for my Excel 2007.
What need to be changed?
The name of the sheet it "Matrix" but I would like to name it COA-Matrix or COA_Matrix.
thanks for help

Private Sub Workbook_Open()
    Matrix.Protect Password:="123456", DrawingObjects:=True, _
        contents:=True, Scenarios:=True, _
        userinterfaceonly:=True
    Matrix.EnableAutoFilter = True
End Sub
0
Comment
Question by:Petersburg1
2 Comments
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 250 total points
ID: 36472586
Assuming you have renamed then try

Chris
Private Sub Workbook_Open()
    Sheets("COA-Matrix").Protect Password:="123456", DrawingObjects:=True, _
        contents:=True, Scenarios:=True, _
        userinterfaceonly:=True
    Sheets("COA-Matrix")EnableAutoFilter = True
End Sub

Open in new window

0
 

Author Closing Comment

by:Petersburg1
ID: 36473844
thanks
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now