+ Reply to Thread
Results 1 to 2 of 2

Conditional Formatting when a Filter is applied

  1. #1
    Registered User
    Join Date
    01-21-2014
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2011
    Posts
    13

    Post Conditional Formatting when a Filter is applied

    So at the plant I work at we have an action plan list that is constantly being shared by all of management. The issue is some people will Filter a column to find items that pertain to them or their department. Then the next person will jump into the document and not realize that a specific column is being filters and will assume the information they are seeing is the entire document. How do i go about highlighting the filtered cell so its obvious to the next user?

    The current code I found from https://excelribbon.tips.net/T013410..._a_Filter.html

    Sub ColorFilterColumn()
    Dim flt As Filter
    Dim iCol As Integer
    Dim lRow As Long
    Dim rTemp As Range
    Dim bFullCol As Boolean

    ' Set as True if you want entire column shaded
    bFullCol = False

    If ActiveSheet.AutoFilterMode Then
    iCol = ActiveSheet.AutoFilter.Range.Column
    lRow = ActiveSheet.AutoFilter.Range.Row
    Application.EnableEvents = False
    For Each flt In ActiveSheet.AutoFilter.Filters
    If bFullCol Then
    Set rTemp = Cells(lRow, iCol).EntireColumn
    Else
    Set rTemp = Cells(lRow, iCol)
    End If

    If flt.On Then
    rTemp.Interior.Color = vbYellow
    Else
    rTemp.Interior.ColorIndex = xlColorIndexNone
    End If

    Set rTemp = Nothing
    iCol = iCol + 1
    Next flt
    Application.EnableEvents = True
    End If
    End Sub

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,427

    Re: Conditional Formatting when a Filter is applied

    Post a sample workbook with some typical data.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. Conditional formatting of one row applied to other rows
    By Daniel Tou in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-08-2015, 10:20 AM
  2. Replies: 1
    Last Post: 10-29-2014, 12:44 AM
  3. [SOLVED] Highlight cells that have conditional formatting applied to them....
    By Thistledown in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-22-2012, 09:09 AM
  4. How to changing conditional formatting once applied
    By mgia0055 in forum Excel General
    Replies: 5
    Last Post: 10-13-2010, 08:15 AM
  5. [SOLVED] can conditional formatting be applied in more then three instance
    By Mary jane in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 12-21-2005, 12:10 AM
  6. [SOLVED] counting cells with conditional formatting applied
    By HalB in forum Excel General
    Replies: 3
    Last Post: 02-21-2005, 10:06 AM
  7. How do I determine if conditional formatting is applied to an exc.
    By MarkTheNuke in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 02-18-2005, 10:06 AM

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