我想使用Excel VBA过滤A:F范围中列F中的所有“X”。这是代码的一部分。选择自动过滤器后,它会给我一个Run-time error '1004' - Method 'Range' of object'_Global' failed
。帮助我:
Function Advanced_Filter()
Sheets("Email").Range("M1").Select
ActiveCell.FormulaR1C1 = "Date"
Range("M2").Select
ActiveCell.FormulaR1C1 = "X"
Range("A2:F2").Select
Selection.AutoFilter
Range("A2:F244").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"Email!Criteria"), CopyToRange:=Range("M3"), Unique:=False