+ Reply to Thread
Results 1 to 5 of 5

Auto filter based on true / false criteria

  1. #1
    Registered User
    Join Date
    08-11-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    3

    Auto filter based on true / false criteria

    Hi,

    I am trying to write a macro which applies an auto filter to a table, but to apply the filter based on a selection of true / false criteria. This is what I have so far..when I run, it doesn't work with the if statement but the second line does work on its own. Any ideas what I'm doing wrong.

    (apologies I'm not sure how to box off the code for this post)


    Please Login or Register  to view this content.


    'this macro is looking at my workbook, sheet12, cell C6 and if the value is True, it's going to sheet2 with my table and filtering out the Y from the 1st column. The go back to sheet12, look in cell C7 and if it's value is FALSE then going back to sheet12 to my table and filtering out the blanks from the 12th column. If I run the 2 AutoFilter rows of code on their own they work, but don't seem to with the if statements in.

    Any help appreciated

    Ross
    Last edited by royUK; 04-27-2012 at 10:39 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Auto filter based on true / false criteria

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    I've added them this time
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Auto filter based on true / false criteria

    is that the complete code?

    It's missing an End If and an End If

    Attach an example workbook

  4. #4
    Registered User
    Join Date
    08-11-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Auto filter based on true / false criteria

    Thankyou Roy

  5. #5
    Registered User
    Join Date
    08-11-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Auto filter based on true / false criteria

    I'm working off my iPad so I can't get my excel file up, hopefully I'll attach it within 3 hours time when I can get back to my laptop,

    thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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