+ Reply to Thread
Results 1 to 10 of 10

Change Font Color Index of row hidden by a Filter

  1. #1
    Registered User
    Join Date
    01-14-2015
    Location
    Wisconsin, United States
    MS-Off Ver
    2013
    Posts
    5

    Change Font Color Index of row hidden by a Filter

    I need to change the Font Color Index of a Range even if the rows are hidden by a Filter.

    My Code is:
    Please Login or Register  to view this content.
    The code works perfect except when some of the rows are hidden by a Filter. I have many filters on many columns and cannot remove them. Is there any way to change the Font Color Index of a Range even if some of the rows are hidden by a filter?
    Last edited by jeffreybrown; 06-01-2019 at 04:25 PM.

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Change Font Color Index of row hidden by a Filter

    How about

    Please Login or Register  to view this content.
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    01-14-2015
    Location
    Wisconsin, United States
    MS-Off Ver
    2013
    Posts
    5

    Re: Change Font Color Index of row hidden by a Filter

    Hi Jeffrey,
    Your code does not work. I want to change all cells in the range not just the visible cells. Thanks for trying.
    Chris

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Change Font Color Index of row hidden by a Filter

    I don't think that it can be done without clearing the filters. I think that I've found a way to capture the existing filter criteria so that it can easily be re-applied, but it is stretching my coding skills, so might take a while.

    Hopefully someone else will post a simpler, alternative method that will work before I lose the little sanity that I have left

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Change Font Color Index of row hidden by a Filter

    This is the best suggestion that I can come up with.

    The first procedure below reads the filters that are applied to the activesheet and saves them to an array. The second procudure re-applies the filters.
    The theory being that you should be able to run the first procedure, then your code to change the font, followed by the second procedure.

    A couple of things to note:-

    The array holding the filter criteria will be lost if any code encounters an unhandled error. This means your font code as well, not just these procedures.
    I've only tested the code with some basic filters, so there are most likely things that I haven't allowed for. Use with caution. Would be best to duplicate your workbook for testing in order to preserve the original.

    Please Login or Register  to view this content.
    Maybe another member can improve this.

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Change Font Color Index of row hidden by a Filter

    You could loop through the range
    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Change Font Color Index of row hidden by a Filter

    Thanks, Fluff! I don't think that I could have over-complicated the task any more if I tried

    Note to self:- Next time, try the obvious instead of assuming that it will not work or has already been tried!

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Change Font Color Index of row hidden by a Filter

    KISS is always best, but we're guilty of over thinking things at times
    However I'm sure you enjoyed creating that code

  9. #9
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: Change Font Color Index of row hidden by a Filter

    Quote Originally Posted by Fluff13 View Post
    You could loop through the range
    Please Login or Register  to view this content.
    I'm not exactly sure what is going on, but looking at the code, would it not be just the same to set the range to that font, there would be no reason to loop

    Please Login or Register  to view this content.

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Change Font Color Index of row hidden by a Filter

    Quote Originally Posted by davesexcel View Post
    I'm not exactly sure what is going on, but looking at the code, would it not be just the same to set the range to that font, there would be no reason to loop
    Nope, that's what the OP posted & it doesn't work

    @Chris Tuttle
    Thanks for the Rep

+ 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. change cell color only if that cells font color is black and it's value is < 2000
    By randall78 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-05-2019, 05:23 PM
  2. Mouse rolls over to cell will change the tab color, font color and tp bold type
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-20-2013, 10:36 AM
  3. Replies: 2
    Last Post: 02-04-2013, 02:00 PM
  4. Change font color based on font color of another cell
    By Ibyers in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2012, 09:36 AM
  5. change font color and font style in shape
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-05-2011, 10:05 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