Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Autofilter function
Based on a macro recording in excel and my experience with the FIND function, I've made the following code but ...:-(
XLAND=1 RANGE=DB.Columns("A:A") RANGE.Select Z=DB.Selection Z.AutoFilter FILTER=Z.AutoFilter("=*cognos*" :: Operator=XLAND,Field=1)
All is ok except the last line which gives me an OLE exception .
Here is the macro code for the following operations
Sub Macro1() ' Macro1 Macro ' Macro recorded 5/08/02 by JVM Columns("A:A").Select Selection.AutoFilter Selection.AutoFilter Field:=1, Criteria1:="=*cognos*", Operator:=xlAnd End SubMy excel file has only one column with a list of software products and my sample is to have all the products where "cognos" is in.
objXL = ObjectOpen("Excel.Application") objXL.Visible = @TRUE objWorkbooks=objXL.WorkBooks objWorkbooks.Open("C:\temp\test.xls") objColumns=objXL.Columns("A:A") objColumns.Select objSelection=objXL.Selection objSelection.AutoFilter xlAnd = 1 objSelection.AutoFilter(:: Field=1, Criteria1="=*cognos*", Operator=xlAnd) ObjectClose(objSelection) ObjectClose(objColumns) ObjectClose(objWorkbooks) ObjectClose(objXL)
Article ID: W15630
File Created: 2003:05:13:11:29:18
Last Updated: 2003:05:13:11:29:18