+ Reply to Thread
Results 1 to 9 of 9

Automatically reapply Filter (Excel 2013)

Hybrid View

  1. #1
    Registered User
    Join Date
    05-22-2014
    Posts
    4

    Automatically reapply Filter (Excel 2013)

    I know this has been asked in some variation or another but I have tried several macros found here and they do not seem to work. Perhaps I am doing something wrong.

    I have a Table ("Table2") in a worksheet ("Dashboard") that contains monthly data arranged in rows. I have made the data fields show #NA for months I want to exclude based on dynamic criteria.
    Now, I would like to automatically filter out the rows (months) with #NA so that they are not charted.
    It works manually but I have to Right Click on the Table --> Filter --> Reapply every time the source data changes. How can I make this happen automatically so that the user does not have to manually reapply each time.

    Thanks in advance.

  2. #2
    Forum Contributor
    Join Date
    06-24-2005
    Location
    excelliot.com
    MS-Off Ver
    2007
    Posts
    325

    Re: Automatically reapply Filter (Excel 2013)

    Hi


    you can replace your formula with
    =iferror(old_formula,0)
    this will convert all error values to zero..

    Cheers!!

  3. #3
    Registered User
    Join Date
    05-22-2014
    Posts
    4

    Re: Automatically reapply Filter (Excel 2013)

    Thank you for the response but that will not work since '0' will be charted.
    This is why I am using #NA for the case were I need the row filtered out.

    I can get it to work manually the way I want by Reapplying the Filter each time after a change is made. The issues is that this is supposed to be a 'no touch' sheet and I would like the filter to apply automatically every time there is a change or the sheet is activated.

  4. #4
    Forum Contributor
    Join Date
    06-24-2005
    Location
    excelliot.com
    MS-Off Ver
    2007
    Posts
    325

    Re: Automatically reapply Filter (Excel 2013)

    you can put "" instead of zero & you can always hide blanks.

  5. #5
    Registered User
    Join Date
    05-22-2014
    Posts
    4

    Re: Automatically reapply Filter (Excel 2013)

    Ok, thank you but I do not have an issue with what to put in a cell for a row I am trying to hide. I can do that easily but my issue is that if the data changes and you need to refresh the auto-filter, it is a manual process.
    I am hoping for help with automatically re-applying the filter when there is change that way rows with data I want to ignore are hidden dynamically.

  6. #6
    Forum Contributor
    Join Date
    06-24-2005
    Location
    excelliot.com
    MS-Off Ver
    2007
    Posts
    325

    Re: Automatically reapply Filter (Excel 2013)

    Ok, what you can do is put this code in sheet in which you want to hide rows automatically..

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Intersect(Target, Range("B1:B1000")) Is Nothing Or Target.Cells.Count > 1 Then Exit Sub
        
            If UCase(Target.Value) = "#N/A" Then
                cell.EntireRow.Hidden = True
            End If
    End Sub
    you can change range to specific range where you will get #N/A

    Cheers!!

  7. #7
    Registered User
    Join Date
    05-22-2014
    Posts
    4

    Re: Automatically reapply Filter (Excel 2013)

    Thank you so much!

  8. #8
    Registered User
    Join Date
    03-03-2015
    Location
    aberdeen, scotland
    MS-Off Ver
    2013
    Posts
    1

    Re: Automatically reapply Filter (Excel 2013)

    Quote Originally Posted by excelliot View Post
    Ok, what you can do is put this code in sheet in which you want to hide rows automatically..

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Intersect(Target, Range("B1:B1000")) Is Nothing Or Target.Cells.Count > 1 Then Exit Sub
        
            If UCase(Target.Value) = "#N/A" Then
                cell.EntireRow.Hidden = True
            End If
    End Sub
    you can change range to specific range where you will get #N/A

    Cheers!!
    I tried to do the same but hide everything but a single value
    So I changed the code like follows, but it doesn't seem to work

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Intersect(Target, Range("B3:K500")) Is Nothing Or Target.Cells.Count > 1 Then Exit Sub
        
            If UCase(Target.Value) = "#N/A" Then
                cell.EntireRow.Hidden = False
    Else:    cell.EntireRow.Hidden = True
            End If
    End Sub

  9. #9
    Forum Contributor
    Join Date
    06-24-2005
    Location
    excelliot.com
    MS-Off Ver
    2007
    Posts
    325

    Re: Automatically reapply Filter (Excel 2013)

    hi

    what exactly you are trying to achieve?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 04-03-2014, 04:47 AM
  2. [SOLVED] Use VB code to reapply a filter
    By barbercabinet58 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-08-2012, 03:18 PM
  3. Replies: 0
    Last Post: 08-30-2012, 04:56 PM
  4. Replies: 0
    Last Post: 05-09-2012, 06:09 PM
  5. Automatically reapply filter based on date
    By Floris in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-30-2010, 04:12 AM

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