Using Excel 2007 and a novice VBA user.
I am trying to write some code that will access the Autofilter list. However, I would like the autofilter list to be arbitary so I will not really know what the criteria will be inside the quotation marks of the code below. Is there a simple solution in VBA for such a problem:
The current code lines may be something of the form:
Selection.AutoFilter
ActiveSheet.Range("$A$1:$E$21").AutoFilter Field:=2, Criteria1:= _
"Unknown Entry 1"
ActiveSheet.Range("$A$1:$E$21").AutoFilter Field:=2, Criteria1:= _
"Unknown Entry 2"
......[an so on....]
and where the Criteria text is different in each spreadsheet I would like to run the code on.
Any solutions or thoughts would be welcome.
Cheers
I am trying to write some code that will access the Autofilter list. However, I would like the autofilter list to be arbitary so I will not really know what the criteria will be inside the quotation marks of the code below. Is there a simple solution in VBA for such a problem:
The current code lines may be something of the form:
Selection.AutoFilter
ActiveSheet.Range("$A$1:$E$21").AutoFilter Field:=2, Criteria1:= _
"Unknown Entry 1"
ActiveSheet.Range("$A$1:$E$21").AutoFilter Field:=2, Criteria1:= _
"Unknown Entry 2"
......[an so on....]
and where the Criteria text is different in each spreadsheet I would like to run the code on.
Any solutions or thoughts would be welcome.
Cheers