N
Nigel
Hi All
I am using an autofilter under VBA control. To set up the customer
conditions I record the macro and adapt the code as required.
Manually the filter works ok, and the resulting code is created and the
filter acts immediately on the datalist showing only those meeting the
criteria specified. The filter relate to some date ranges shown on the sheet
in European format.
If I remove the filter and run the recorded macro, the filter is put in
place, the Custom conditions are set BUT all rows are filtered. If I open
the filter to check the criteria settings, they are as requested by the
macro. If I then click OK on the filter the resultant list is filtered
correctly with conditions being applied correctly !!
I suspect it is to do with the DATES - but cannot reconcile the difference
between the Manual application and the VBA macro? Thoughts anyone?
Using Xl97 (v8) as the target application, but I get the same in xlXP (v10).
Recorded (unedited code below)
Range("A4:C4").Select
Selection.AutoFilter
Selection.AutoFilter Field:=3, Criteria1:=">=19/10/2005", Operator:=xlAnd
_
, Criteria2:=">=15/11/2005"
I am using an autofilter under VBA control. To set up the customer
conditions I record the macro and adapt the code as required.
Manually the filter works ok, and the resulting code is created and the
filter acts immediately on the datalist showing only those meeting the
criteria specified. The filter relate to some date ranges shown on the sheet
in European format.
If I remove the filter and run the recorded macro, the filter is put in
place, the Custom conditions are set BUT all rows are filtered. If I open
the filter to check the criteria settings, they are as requested by the
macro. If I then click OK on the filter the resultant list is filtered
correctly with conditions being applied correctly !!
I suspect it is to do with the DATES - but cannot reconcile the difference
between the Manual application and the VBA macro? Thoughts anyone?
Using Xl97 (v8) as the target application, but I get the same in xlXP (v10).
Recorded (unedited code below)
Range("A4:C4").Select
Selection.AutoFilter
Selection.AutoFilter Field:=3, Criteria1:=">=19/10/2005", Operator:=xlAnd
_
, Criteria2:=">=15/11/2005"