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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top