how to filter first column only in range

G

Guest

Hey eb
I need to filter column A only in some sheet.
I'm having trouble with setting the Field parameter in autofilter().

This is my code:

Set xlApp = CreateObject("Excel.Application")
Set xlWb = xlApp.workbooks.Open("D:\myExcel.xls")
Set xlWs = xlWb.Worksheets("myWorkSheet")
xlWs.Activate
xlWs.Range("A1:Z1").AutoFilter 1 =>filters all columns in sheet
xlWs.Range("A1:Z1").AutoFilter Field:=1 =>filter fails will error...

Any advice??

TIA
Rea
 
W

William Benson

what is the criteria? should be in format:

Selection.AutoFilter Field:=1, Criteria1:="<= 100"
 

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