ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Using AutoFilter with worksheet protection in 2000 vs. 2003 (https://www.excelbanter.com/excel-discussion-misc-queries/36417-using-autofilter-worksheet-protection-2000-vs-2003-a.html)

gncook

Using AutoFilter with worksheet protection in 2000 vs. 2003
 
I have created an Autofilter on 2 columns of a protected worksheet in 2000
using a macro that runs upon opening of the worksheet. I am encountering a
problem when a 2003 user tries to open the worksheet but cannot use the
AutoFilter dropdowns. I know that in 2003 it is much easier to use the
Autofilter on a protected worksheet with the AutoFilter option. Anyone have
any ideas how I can create the AutoFilter/Protected worksheet situation that
will work no matter what Excel version is being used?

Jim Rech

When I run this code from Workbook_Open in either Excel 2000 or 2003 auto
filtering seems to work okay on the protected sheet:

Sub ProtectSheet()
With Sheet1
.EnableAutoFilter = True
.Protect , True, True, True, True
End With
End Sub

--
Jim
"gncook" wrote in message
...
|I have created an Autofilter on 2 columns of a protected worksheet in 2000
| using a macro that runs upon opening of the worksheet. I am encountering a
| problem when a 2003 user tries to open the worksheet but cannot use the
| AutoFilter dropdowns. I know that in 2003 it is much easier to use the
| Autofilter on a protected worksheet with the AutoFilter option. Anyone
have
| any ideas how I can create the AutoFilter/Protected worksheet situation
that
| will work no matter what Excel version is being used?



Dave Peterson

If you already have the outline applied, you can protect the worksheet in code
(auto_open/workbook_open??).

Option Explicit
Sub auto_open()
With Worksheets("sheet1")
.Protect Password:="hi", userinterfaceonly:=True
.EnableAutoFilter = True
End With
End Sub

It needs to be reset each time you open the workbook. (excel doesn't remember
it after closing the workbook.)

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

gncook wrote:

I have created an Autofilter on 2 columns of a protected worksheet in 2000
using a macro that runs upon opening of the worksheet. I am encountering a
problem when a 2003 user tries to open the worksheet but cannot use the
AutoFilter dropdowns. I know that in 2003 it is much easier to use the
Autofilter on a protected worksheet with the AutoFilter option. Anyone have
any ideas how I can create the AutoFilter/Protected worksheet situation that
will work no matter what Excel version is being used?


--

Dave Peterson

gncook

Thanks Dave! This worked fine.

"Dave Peterson" wrote:

If you already have the outline applied, you can protect the worksheet in code
(auto_open/workbook_open??).

Option Explicit
Sub auto_open()
With Worksheets("sheet1")
.Protect Password:="hi", userinterfaceonly:=True
.EnableAutoFilter = True
End With
End Sub

It needs to be reset each time you open the workbook. (excel doesn't remember
it after closing the workbook.)

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

gncook wrote:

I have created an Autofilter on 2 columns of a protected worksheet in 2000
using a macro that runs upon opening of the worksheet. I am encountering a
problem when a 2003 user tries to open the worksheet but cannot use the
AutoFilter dropdowns. I know that in 2003 it is much easier to use the
Autofilter on a protected worksheet with the AutoFilter option. Anyone have
any ideas how I can create the AutoFilter/Protected worksheet situation that
will work no matter what Excel version is being used?


--

Dave Peterson



All times are GMT +1. The time now is 02:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com