Consulting

Results 1 to 5 of 5

Thread: Creating a dynamic #N/A Filter for EXCEL.

  1. #1
    VBAX Newbie
    Joined
    Nov 2017
    Posts
    2
    Location

    Post Creating a dynamic #N/A Filter for EXCEL.

    I have a set of data which I need to remove the #N/A for a table. This is the last thing I need to do for my project I am working on. Unfortunately, this has not been as easy as I have imagined. I have already filtered the table and am wanting to additionally add a #N/A filter so the data can look nice and neat.


    NA homie.jpg






    I have tried:
     wb1.ListObjects("Table1").Range.AutoFilter Field:=1, Criteria1:="=#N/A"
    All this does it make my data filled with #N/A. Where as I want to remove the #N/A for column 1

    The below works though it's not for dynamic data

    Sub Macro2()
    '
    ' Macro2 Macro
    '
    
    
    '
        ActiveSheet.ListObjects("Table2").Range.AutoFilter Field:=1, Criteria1:= _
            Array("Nov 13", "Nov 13", "Today", _
       ), Operator:= _
            xlFilterValues
    End Sub
    ActiveSheet.Range("A:A").AutoFilter Field:=1, Criteria1:="#N/A"
    Any ideas. I've been stuck on this for a while now and it's the last thing I need to do so I can finish my project. Thanks.

  2. #2
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,645
    You'd beter prevent #N/A from popping up.

  3. #3
    VBAX Newbie
    Joined
    Nov 2017
    Posts
    2
    Location
    In this case, I want to filter out N/A. Something like:
    wb1.ListObjects("Table1").Range.AutoFilter Field:=1, Criteria1:= _ Array("*"), Operator:=xlFilterValues
    though dynamic would be great. As its the only way to clean my data up. It has been some time since I have looked at this VBA code and it shows. I suppose I could alternatively transfer this to another excel, remove N/A...... plus rows that were removed/adjacent to/by N/A. Might be only option at this point.

  4. #4
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Column AA has a formula.
    Edit the Formula with
    IF ISERROR(Original formula), "", (Original Formula))
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  5. #5
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    Maybe

    Range("AA").SpecialCells(xlCellTypeFormulas, xlErrors).EntireRow.Delete
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Tags for this Thread

Posting Permissions

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