Hi,
Is there a way to iterate through the different selections of an autofilter via VBA? Is there any kind of code that would help me select each item in the autofilter one by one, so that i could apply some formulae to it.
Now i have the following code:
Range("A1").Select
Selection.autofilter
ActiveSheet.Range("$A$1:$W$12").autofilter Field:=4, Criteria1:= _
"Inv Copies"
a = ActiveSheet.Range("a1", ActiveSheet.Range("a1").End(xlDown)).Count
b = a * 0.25
c = b + 1
Rows(Irow + c).Resize(ActiveSheet.Range("a1", ActiveSheet.Range("a1"). _
End(xlDown)).Count - c).Delete
ActiveSheet.Range("$A$1:$W$12").autofilter Field:=4, Criteria1:= _
"Closing Future"
a = ActiveSheet.Range("a1", ActiveSheet.Range("a1").End(xlDown)).Count
b = a * 0.25
c = b + 1
Rows(Irow + c).Resize(ActiveSheet.Range("a1", ActiveSheet.Range("a1"). _
End(xlDown)).Count - c).Delete
---------------------------------------------------------
but i donot want to mention the criteria again and again. Moreover i may have a new list tomorrow where i may add/delete certain names. So i want a dynamic code which will select each item in the autofilter one by one and apply the formula.
i am sorry for my ignorance but i am very new to VBA.
Can anybody help me out. It is urgent!
thank you,
Ron_N
Is there a way to iterate through the different selections of an autofilter via VBA? Is there any kind of code that would help me select each item in the autofilter one by one, so that i could apply some formulae to it.
Now i have the following code:
Range("A1").Select
Selection.autofilter
ActiveSheet.Range("$A$1:$W$12").autofilter Field:=4, Criteria1:= _
"Inv Copies"
a = ActiveSheet.Range("a1", ActiveSheet.Range("a1").End(xlDown)).Count
b = a * 0.25
c = b + 1
Rows(Irow + c).Resize(ActiveSheet.Range("a1", ActiveSheet.Range("a1"). _
End(xlDown)).Count - c).Delete
ActiveSheet.Range("$A$1:$W$12").autofilter Field:=4, Criteria1:= _
"Closing Future"
a = ActiveSheet.Range("a1", ActiveSheet.Range("a1").End(xlDown)).Count
b = a * 0.25
c = b + 1
Rows(Irow + c).Resize(ActiveSheet.Range("a1", ActiveSheet.Range("a1"). _
End(xlDown)).Count - c).Delete
---------------------------------------------------------
but i donot want to mention the criteria again and again. Moreover i may have a new list tomorrow where i may add/delete certain names. So i want a dynamic code which will select each item in the autofilter one by one and apply the formula.
i am sorry for my ignorance but i am very new to VBA.
Can anybody help me out. It is urgent!
thank you,
Ron_N