+ Reply to Thread
Results 1 to 2 of 2

changing the colour of a header cell when filtering

  1. #1
    Registered User
    Join Date
    10-26-2011
    Location
    Chester, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    changing the colour of a header cell when filtering

    Hi all - I've got this piece of code to change the colour of the header cell being filtered on in a spreadsheet (you click the cell to filter, and it changes colour - makes it easier for users to spot which cell is filtered - the little blue arrow isn't always obvious apparently). Anyway, the code works fine; however, it keeps firing, so the function is constantly running. This makes it practically impossible to copy data between sheets and workbooks; switching between workbooks means minimising one before maximising another. Has anyone got any ideas how to get the function to only fire when a sheet is filtered, or have an alternative to what I have already?


    Please Login or Register  to view this content.


    Thanks in advance

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,430

    Re: changing the colour of a header cell when filtering

    rather than make the function volatile include an argument that is based on the data that will cause it to recalculate.

    so assuming your your formula is,

    =AutoFilterOn(A1)

    change it to, where A1:A257 is the column of data being filtered.

    =AutoFilterOn(A1,(COUNTA(A1:A257)-SUBTOTAL(103,A1:A257)))

    The function will then change to

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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