+ Reply to Thread
Results 1 to 3 of 3

Conditional Formatting like Color Scale but doing it via Interior.Color

  1. #1
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Conditional Formatting like Color Scale but doing it via Interior.Color

    Hi,

    I'm trying to add some static Interior.Color formats to cells but in the format of a color scale, the same as what conditional formatting would do but without the use of conditional formatting, by doing this it would make the cells 100% mobile compatible (compatible with Goggle sheets and other apps that disallow conditional formatting) aswell as making it faster, smaller (in file size) and won't change if you remove the any rows or change some values.

    However, you could use it as a backup "underlay" where by a backup color scheme would be the static formatting under the conditional formatting which would only show on apps that disallow conditional formatting, so basically turning this into a fallback.

    An example set of data to use is the following CSV data which will help explain what I am trying to achieve.

    Please Login or Register  to view this content.

    If you were to run the macro below would see the output I am wanting to achieve but the problem is this route is using conditional formatting, I am wanting to do it WITHOUT conditional formatting.

    Please Login or Register  to view this content.

    After running it, you'd see the following:

    Vqp6leQ.png


    The colors that I would want the scale to be based on are:

    GREEN: 99/190/123 (RGB) or 8109667 (Interior.Color)
    YELLOW: 255/235/132 (RGB) or 8711167 (Interior.Color) (Mid-point)
    RED: 248/105/107 (RGB) or 7039480 (Interior.Color)

    I've found the following: http://www.cpearson.com/Excel/cformatting.htm but unfortunately it isn't compatible with Excel 2007 onwards (I am using Excel 2013), If the conditional formatting colors can be detected then a "hacky" workaround would suffice but it's very much possible (although I don't know how) to do it with a histogram.

    This request could be very much an assest to other VBA and excel users as some people might not want colors to change if values are changed or rows are removed and also anyone opening sheets with this requested color scale formatting would be able to view the colors on/in services and apps like Google Sheets which strips out all conditional formatting and thus leaves the page completly blank which is far from ideal. I'm surpised Excel didn't include an easy "Convert to Static Formatting" or a fallback option like this for conditional formatting.

    Hopefully someone can help and has an idea or method of doing this, it would be much appreciated.

    See attached for example data + another description of how/what I want to achieve.
    Attached Files Attached Files

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

    Re: Conditional Formatting like Color Scale but doing it via Interior.Color

    this simple approach that will work with xl2010 onwards

    Please Login or Register  to view this content.
    It uses conditional formatting to get the colour via the DisplayFormat object of the cell.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Conditional Formatting like Color Scale but doing it via Interior.Color

    Oh wow, I didn't know about the "DisplayFormat" function, that is awesome!

    Works perfectly, thank you. I'm impressed!

+ 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. Color Scale Conditional Formatting
    By dev.jajati in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-12-2014, 04:10 AM
  2. Help with conditional formatting 3 color scale
    By ab0mbs in forum Excel General
    Replies: 1
    Last Post: 09-24-2013, 12:43 PM
  3. [SOLVED] How To Check Interior Color Set By Conditional Formatting?
    By hhost in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-07-2013, 07:33 AM
  4. [SOLVED] Conditional formatting interior color from comparing two cell values VBA
    By Blue_Diamond in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-27-2012, 11:24 AM
  5. Conditional Formatting 3 color scale
    By Kagesen in forum Excel General
    Replies: 15
    Last Post: 05-03-2012, 08:50 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