View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default filters and macros

Hi Martin,

(comma === dot/drop)


was intended as:

(comma === dot / stop)

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Martin,

I ran your macro on data designed to mimic your autofilter range and,
once I had changed the first criterion from 0,5 to 0.5 (comma ===
dot/drop) to accord with my local settings, it filtered my data as
expected.

---
Regards,
Norman



"Martin" wrote in message
...
Hello,
I do have a spreadsheet, where I do have created auto filter.
When I manually set the custom autofilter logic, the correct data will be
filtered.

Now I recorded a macro, which sets the autofilter, copys some subtotal
results and then sets some other filters, where it does the same.

=============
Macro
=============
Selection.AutoFilter Field:=13, Criteria1:="0,5", Operator:=xlAnd, _
Criteria2:="<=1"
Range("T1").Select
Application.CutCopyMode = False
Selection.Copy
Range("AP2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("U1").Select
Application.CutCopyMode = False
Selection.Copy
Range("AP3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
==================

When I now run the filter, no rows will be selected.

If I go into debug mode and set a breck point after the first cut
function,
I can see that the filter was set by the macro, but not activated.

Any idear what when wrong in the recording?