Results 1 to 8 of 8

Macro to autofilter if summary list is "Yes"

Threaded View

  1. #1
    Registered User
    Join Date
    09-27-2012
    Location
    Johannesburg
    MS-Off Ver
    Excel 2007
    Posts
    5

    Macro to autofilter if summary list is "Yes"

    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!
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Run Macros on all except "Summary" and "Reports" worksheets in a workbook
    By daralea in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2013, 05:42 PM
  2. Replies: 1
    Last Post: 05-09-2013, 02:05 AM
  3. [SOLVED] Need Macro to compile data from "Weekly" sheets and sum up into "Monthly" summary sheet
    By mo4391 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-21-2013, 07:25 PM
  4. How to solve same date problem in "Summary List"?
    By peri1224 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-19-2012, 12:25 PM
  5. Replies: 14
    Last Post: 11-29-2012, 02:58 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1