Error with a Macro

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.
 
T

Tom Ogilvy

try

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

Sondra Powers

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.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 

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

Top