Auto Filter with Earlier Versions of Excel

Fujirich

Active Member
Joined
May 1, 2003
Messages
320
I'm using auto filter in a workbook that may be used by folks with a variety of Excel versions. In my version (2003) I have no problem unsing the following code, hooked to a button to turn the feature on/off

Code:
Sub AutoFilter_On_Off()
'
Application.ScreenUpdating = False
ActiveSheet.Unprotect ("egssales")
    Range("A9:M1009").Select
    Selection.AutoFilter
    Range("A1").Select
ActiveSheet.Protect ("egssales"), AllowFiltering:=True
Application.ScreenUpdating = True
End Sub

A9:M9 are the headings, which are protected. The rest of the range is unprotected.

I just talked with one of my users who tells me the auto filter on/off button is causing a run time error. I believe he has either Excel 2002 or 2000.

Is there anything I can do to allow this to work for these earlier versions of Excel?

Thanks!

Rich
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
In Excel 2000 it's:

Code:
ActiveSheet.EnableAutoFilter = True
ActiveSheet.Protect contents:=True, userInterfaceOnly:=True

The Protect method doesn't have an AllowFiltering argument.
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top