+ Reply to Thread
Results 1 to 4 of 4

Cannot AutoFilter By Exclusion using VBA

  1. #1
    Registered User
    Join Date
    04-07-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    22

    Cannot AutoFilter By Exclusion using VBA

    Hello:

    I have a column that that is populated by #'s. They are there as a result of a VLOOKUP; I now want to filter OUT all the "#N/A" cells for the field.

    I cant use a specific array because the data changes every week.

    I started writing VBA about 2 months ago, so please be explicit with any suggestions/answer's.

    My code is as follows:

    Please Login or Register  to view this content.
    I have also tried:
    Criteria1:<> "#N/A"
    Criteria1:=<> "#N/A"



    Thank you in advance
    Brad

  2. #2
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: Cannot AutoFilter By Exclusion using VBA

    Hi Brad,

    It'll be something like this, using the Range.Autofilter method and with no space between the <> and #N/A

    Please Login or Register  to view this content.
    Change A:AZ to suit your range.
    Hope that helps,

    Colin

    RAD Excel Blog

  3. #3
    Registered User
    Join Date
    04-07-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Cannot AutoFilter By Exclusion using VBA

    ok thanks, I'm going to try that

    What does: "ActiveSheet.AutoFilterMode = False" do?

  4. #4
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: Cannot AutoFilter By Exclusion using VBA

    Hi,
    What does: "ActiveSheet.AutoFilterMode = False" do?
    It makes sure that the Activesheet doesn't already have an Autofilter on it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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