Solved

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

Posted on 2011-09-02
2
468 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 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

21 Experts available now in Live!

Get 1:1 Help Now