+ Reply to Thread
Results 1 to 5 of 5

Urgent help with vba for conditional chart fill colour change

  1. #1
    Forum Contributor
    Join Date
    04-09-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    250

    Question Urgent help with vba for conditional chart fill colour change

    I have a spread sheet with various tick boxes, that when ticked calculate an accumulative percentage in a cell. This cell is the basis of my graph.
    e.g. if the cell displays 80% - the chart with show 80% - simple.

    however, I want to write a vba code that changes the fill colour of the chart depending on the percentage.

    i.e. if the percentage data = 0-49% I wish the chart to display as red. 50-69% - yellow and 70%+ = green.

    is this possible to achieve via simple vba?


    thanks.

    ive attached the sheet as example
    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: Urgent help with vba for conditional chart fill colour change

    No need for VBA, just a few formula and a chart with 3 series.
    Set the series to be 100% overlapped.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    04-09-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: Urgent help with vba for conditional chart fill colour change

    Thanks!

    But how did you make it change colour without even conditional formatting? or am I missing something obvious..

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

    Re: Urgent help with vba for conditional chart fill colour change

    You are missing the fact the chart now has 3 series instead of 1.
    Only 1 series is displayed because the formula sets the data point to #N/A if not valid.

  5. #5
    Forum Contributor
    Join Date
    04-09-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: Urgent help with vba for conditional chart fill colour change

    Oh I see. Thanks again. Appreciate it.

+ 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. Conditional colour fill
    By Bebbspoke in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-08-2012, 06:16 AM
  2. Colour change column chart based on cell colour
    By Alice21 in forum Excel General
    Replies: 11
    Last Post: 04-05-2011, 10:10 AM
  3. Conditional Formatting Fill colour with weekday colour
    By nattasiray in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-17-2008, 06:49 AM
  4. conditional fill colour
    By AK in forum Excel General
    Replies: 2
    Last Post: 04-07-2006, 10:25 AM
  5. [SOLVED] conditional fill colour
    By AK in forum Excel General
    Replies: 3
    Last Post: 04-07-2006, 09:40 AM

Tags for this Thread

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