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
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