Checking Filter Highlight Status RRS feed

  • Question

  • Hi,

    I'd like to check the status of the filter before re-applying it. (Project 2010)


    Private Sub Project_Change(ByVal pj As Project)

        Dim txtFilter As String
        Dim blHighlight As Boolean


        If CurrentFilter.Highlight = True then blHighlight = True else blHighlight = False

        txtFilter = CurrentFilter
        FilterApply txtFilter, blHighlight

    End Sub

    - I do this in the ThisWorkbook Change event, so after a change is made project re-applies the filter and the update is applied immediately, disappearing the yellow line.

    If you have any other suggestions on how to do this feel free to post, eg an option to automatically re-apply that I've missed.

    • Edited by pbyrne98 Wednesday, October 22, 2014 5:39 AM
    Wednesday, October 22, 2014 5:31 AM

All replies

  • Hi Pbyrne98, what is it that you are trying to do?

    Ben Howard [MVP] | web | blog | book

    Wednesday, October 22, 2014 6:30 AM
  • Hi pbyrne98,

    Use following code to check if a highlight filter is selected:

    Dim viewSingle As viewSingle For Each viewSingle In Application.ActiveProject.ViewsSingle If (ActiveProject.CurrentView = viewSingle.Name) Then Debug.Print viewSingle.Name Debug.Print viewSingle.HighlightFilter If viewSingle.HighlightFilter = True Then ' Highlight filter

    Exit For

    End If End If Next

    Hope this helps

    Wednesday, October 22, 2014 8:20 AM