Hi All,
I have been looking through the forums for most of this morning and haven't come across a solution that I have managed to make work for me. I was hoping you could help and have attached my sample sheet.
In the sheet "Summary" i have options which my user must select yes or no to e.g.
Option 1 : Yes
Option 2 : Yes
Option 3 : No
Option 4 : Yes
Then in sheet "Output" i want to aAutofilter column A based on the Yes or No of sheet "Summary" i.e. only to show those items where it is marked as yes. I have managed to do this with hard coding to test that it can be done, and i get that to work fine. However when i try to introduce an array to store which options are Yes, so that i can use it in my autofilter, it doesn't work.
Please, any help would be great!!
I haven't used arrays in VB before and am really struggling, i am using Excel 2007.
Option Explicit
Sub FilterfromArray()
Dim MyArray(1) As Variant
With ActiveSheet
MyArray(0) = ("5")
MyArray(1) = ("2")
ActiveSheet.Range("A1:A274").AutoFilter Field:=1, Criteria1:=Application.Transpose(MyArray), _
Operator:=xlFilterValues
End With
End Sub
MANY THANKS!
Bookmarks