AutoFilter Strangeness

ChrisY

New Member
Joined
Feb 27, 2002
Messages
7
Hello,

I have a workbook that has several buttons that are created on workbook open. Each button runs a macro that changes an AutoFilter value of a column. The project was created in Excel 2000, where all works fine. I am having a problems with users who have Excel 97 - when they click on some (not all (!!)) buttons, they get the error message "RunTime Error '1004' AutoFilter method of RangeClass failed".

Everything works fine in Excel 2000 and some of the code works fine in Excel 97. I'm LOST!

What gives? Some sample code below.

Thanks for any thoughts / solutions.

Chris York

Sub TR35()
Application.ScreenUpdating = False
'Resets all Filters to "All"
Run "Clear"
'Sets TR NPR (00-01) to "<=35"
Application.ScreenUpdating = False
Worksheets("StudentData").Select
Selection.AutoFilter , Field:=21, Criteria1:="<=35.0"
Range("A1").Select
End Sub

Sub Clear()
Application.ScreenUpdating = False
Worksheets("StudentData").Select
'Show Print Filters
Columns("E:G").Select
Selection.EntireColumn.Hidden = False
Columns("J:W").Select
Selection.EntireColumn.Hidden = False
'Shows TR Columns
Worksheets("StudentData").Select
Columns("X:AA").Select
Selection.EntireColumn.Hidden = False
Columns("AF:AI").Select
Selection.EntireColumn.Hidden = False
Columns("AN:AQ").Select
Selection.EntireColumn.Hidden = False
Range("A1").Select
Application.ScreenUpdating = True
On Error GoTo Skip
Worksheets("StudentData").Select
Worksheets("StudentData").ShowAllData
Worksheets("StudentData").Select
Skip:
'Application.CalculateFull
Range("A1").Select
End Sub
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,078
Latest member
skydd

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