vba to auto-filter multiple criterias within sentence

rommel89

New Member
Joined
Sep 6, 2014
Messages
3
Hey guys,

I have this table. I want vba to autofilter then copy to new sheet but I cant run this macro within sentences.

Here is my macro and table:

Sub macrofilter()


Dim arr()
Dim arr2()
c = -1
x = [A65536].End(3).Row
ActiveSheet.[a6].AutoFilter
For i = 7 To x
arr2 = Array("phone", "mkk", "tax", "share", "paypal", ) 'notice that there is no paypal in data'




For j = 0 To UBound(arr2)
If Cells(i, "a") = arr2(j) Then s = s + 1
Next
If s = 0 Then
c = c + 1
ReDim Preserve arr(0 To c)
arr(c) = Cells(i, "a")
End If
s = 0
Next
ActiveSheet.Range("$a$6:$c$" & x).AutoFilter Field:=3, Criteria1:=arr(), Operator:=xlFilterValues
MsgBox "The End"
End Sub


Date---------Time------ -Explanation-----------
01.03.2014- 01:00:00- Iphone6
14.07.2013- 03:00:00- Tax and income
12.11.2013- 09:00:00- shareholder
17.02.2013- 12:30:00- mkk comes

İndir makro xlsm
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,215,670
Messages
6,126,127
Members
449,293
Latest member
yallaire64

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top