Error with a Macro

  • Thread starter Thread starter Sondra
  • Start date Start date
S

Sondra

I have a user who has created a spreadsheet with macros
for each column to run various reports. Each macro reads
the same; however the last column macro keeps erroring
out. I have tried correcting the statement and still can
not get it to run.

Range ("AN1"). Select
Selection.AutoFilter
Selection.AutoFilter Field:=40, Criteria1:="x"

The last statement is the one that keeps erroring. Can
anyone help. I'm very novice to Excel Macros.

Thanks.
 
try

Range ("A1:AN1").CurrentRegion.Select
Selection.AutoFilter
Selection.AutoFilter Field:=40, Criteria1:="x"
 
Tom:

Tried it and it didn't work
Range("A1:AN1").CurrentRegion.Select
Selection.AutoFilter

Selection.AutoFilter Field:=40, Criteria1:="x" (THIS ROW ERRORING)

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Selection.AutoFilter

Any help would be appreciated.
 
Back
Top