+ Reply to Thread
Results 1 to 4 of 4

Change Cell Color to Gradient Based on Adjacent Cell Colors

  1. #1
    Registered User
    Join Date
    01-20-2013
    Location
    Washington D.C.
    MS-Off Ver
    Excel 2010
    Posts
    8

    Change Cell Color to Gradient Based on Adjacent Cell Colors

    I have a color based chart, and want to make a button which will blend all the selected cells (With.Selection.Interior) by creating a gradient based on the cells on the right and left of the selected cell. For example,

    Cell B4=Yellow
    Cell B6=Red

    I want cell B5 to be a gradient from yellow into red. This will all be activated by a button, no need for automation.

    **To clarify, the adjacent cell colors will already be selected manually by the user.

    I have tried several different ways of going about it, but the bottom line is I can't set cell colors based on relative cells. Thanks in advance.

    (I cannot attach the chart for proprietary reasons, sorry)

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Change Cell Color to Gradient Based on Adjacent Cell Colors

    The following works if the cell between the two coloured cells is selected

    Please Login or Register  to view this content.
    Martin

  3. #3
    Registered User
    Join Date
    01-20-2013
    Location
    Washington D.C.
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Change Cell Color to Gradient Based on Adjacent Cell Colors

    You sir, are a genius. It's so simple, it's beautiful.

    If you can answer the follow up, you will make my life perfect.

    When selecting multiple cells with the same adjacent cell colors (i.e. A1 and B1 are green, A3 and C3 are yellow), it works perfectly.

    However, if multiple cells are selected, and adjacent cells are different colors (i.e A1 is yellow and A3 is green, but C1 is red and C3 is purple), then the return is black.

    I am only using three colors (red, yellow, and green) in the sheet. Is there any way to complete multiple gradient shifts at once?

    Thank you again.

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Change Cell Color to Gradient Based on Adjacent Cell Colors

    Maybe this ???

    Please Login or Register  to view this content.

+ 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