+ Reply to Thread
Results 1 to 2 of 2

How to assign color theme on FALSE

  1. #1
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,104

    How to assign color theme on FALSE

    Hello Excel Gurus,

    Traditionally, when we create a chart in Excel, Excel automatically assign color for each series and I believe this is via MS Excel Office Color Themes.

    What I'm trying to do here is that I'd like to assign a specific color for each string/series. However, the string types (series) may change as time grows. Thus, if there's 'new' string/series that wasn't account for, I'd like macro to automatically assign color like the traditional way based on the number of 'new' strings/series.

    The logic goes like this:

    If string/series = "A", then assign color [Red] else
    If string/series = "B", then assign color [Blue] else
    assign color theme for each string/series.

    Is it doable? If so, what's the syntax for macro to assign automatically assign color based on the number of string/series that I didn't account for?

    Thank you!

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: How to assign color theme on FALSE

    Here is my shot at it. Create a table called Table_Chart_Color with the column title series as shown. Fill in the Series Names and then fill in the cell with the desired colors.

    Change the test macro to match the sheet name and the chart name
    Please Login or Register  to view this content.
    Run this code.
    Attached Files Attached Files
    Last edited by dflak; 11-15-2023 at 06:00 PM. Reason: Clarify explanation
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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 show Theme color window with Excel VBA?
    By mohsin.bipu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2023, 04:09 AM
  2. Changing cells to be the theme color?
    By DarkSoul in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 10-20-2020, 01:33 PM
  3. [SOLVED] How to change Theme Color from Accent to ColorIndex
    By Stealth2017 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-01-2018, 02:01 AM
  4. VBA workaround to set workbook color theme
    By Sintek in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-26-2018, 08:51 AM
  5. Replies: 1
    Last Post: 12-07-2016, 08:03 PM
  6. Any way to apply a color theme by changing the color of one cell ?
    By KomicJ in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-02-2016, 01:11 PM
  7. Changing color theme
    By Eashworth in forum Excel General
    Replies: 5
    Last Post: 08-24-2015, 10:59 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