Results 1 to 11 of 11

VBA create chart with specific colors

Threaded View

  1. #1
    Registered User
    Join Date
    05-19-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    18

    VBA create chart with specific colors

    Hi @all,

    I've one excelsheet with 2 tables. Table 1 is called "Auswertung" and should only showing the chart. Table 2 is called "Tabelle2" and includes the Range("A1:B23"). In A there are several categories and B is counting how often the categories are found in another excelsheet . The following macro is creating one chart for me:

    Sub Diagramm()
    Dim ch As ChartObject
    Set ch = ActiveSheet.ChartObjects.Add(Cells(7, 2).Left, Cells(7, 2).Top, 400, 250)
    With ch.Chart
        .ChartType = xlColumnClustered
        .SetSourceData Source:=Sheets("Tabelle2").Range("A1:B23"), PlotBy:=xlColumns
        .HasLegend = False
        .Axes(xlCategory, xlPrimary).HasTitle = False
        .Axes(xlValue, xlPrimary).HasTitle = False
        .HasTitle = False
    End With
    End Sub
    The columns in this charts have the same color, but I want different colors if the value of "B" is bigger than 2. So how would it look then?

    Thx@all
    Last edited by lucascaletta; 07-22-2014 at 08:16 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to create a specific dual axis chart
    By rgold in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-16-2009, 10:51 AM
  2. [SOLVED] create chart /table excel-save, close & reopen colors change? Why
    By Anne in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-04-2006, 04:20 PM
  3. [SOLVED] HOW TO CREATE A BUBBLE CHART WITH CHANGING COLORS?
    By Hector in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-14-2006, 12:45 PM
  4. macor to create chart/graph for a specific row of data
    By slice.cheese@googlemail.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-07-2006, 04:20 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