+ Reply to Thread
Results 1 to 3 of 3

VBA autofilter non-blanks AND no fill color

  1. #1
    Forum Contributor
    Join Date
    06-19-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Office365
    Posts
    273

    VBA autofilter non-blanks AND no fill color

    Hello,

    I need some codes that filter out non-blank cells and cells without color fill.

    not sure how to put these two together using Operator:=xlAnd?

    Please Login or Register  to view this content.
    thanks!
    Last edited by Pepe Le Mokko; 01-15-2020 at 03:14 AM. Reason: Added code tags. Please read fourm rules

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: VBA autofilter non-blanks AND no fill color

    Hi,

    AutoFilter does not allow more than one operation on the same field. You can get around the limitation by creating two Helper Columns which can be hidden if you want so the look and feel of your data table can remain the same.

    The Helper Columns would be:
    a. The RGB value of the color as a Long Integer (e.g. White = no color = 16777215, Red = 255, etc.). Alternately the ColorIndex could be used.
    For more information see: http://dmcritchie.mvps.org/excel/colors.htm
    b. Column containing 'Yes' or 'No' to (non-blank cells and cells without color fill) based on the Value in your original column and the first Helper cell 16777215 value.

    AutoFilter would then be applied to the 2nd Helper Column.

    Code to create the Helper Columns could be similar to:
    Please Login or Register  to view this content.
    See the attached file for working examples of your problem and more.

    Lewis

  3. #3
    Forum Contributor
    Join Date
    06-19-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Office365
    Posts
    273

    Re: VBA autofilter non-blanks AND no fill color

    Thank you so much Lewis for your time! This is awesome!

+ 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. How to automatically sum based upon interior fill color when the fill color changes
    By Murman01 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-10-2017, 10:41 AM
  2. Delete CF fill color, replace with regular fill color. Short code, can't figure it out!
    By excelfriend1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-11-2016, 09:03 PM
  3. [SOLVED] How to fill color cells based on another cell's fill color?
    By putritersenyum in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-22-2016, 08:58 AM
  4. [SOLVED] Click oval option button to fill/unfill color, also change border color to match fill
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-07-2015, 08:29 PM
  5. Ignore the color fill in cells for autofilter
    By AustinLe in forum Excel General
    Replies: 1
    Last Post: 06-27-2014, 04:54 PM
  6. [SOLVED]Fill Color (highlight cells) but not to print fill color
    By itszille in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-24-2012, 05:37 PM

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