Results 1 to 2 of 2

Bar of Pie Chart - Colors

Threaded View

  1. #1
    Registered User
    Join Date
    07-01-2014
    Location
    Jefferson County, WI
    MS-Off Ver
    2010/2013
    Posts
    1

    Bar of Pie Chart - Colors

    Hi,
    I’m extremely new to VBA and macros, literally started teaching myself yesterday to make better/more efficient graphs to represent data for work, so please forgive me for my inexperience.

    But I'm compiling data into Bar of Pie charts and am wondering if it's at all possible to program the "Other" slice to be a certain color. The macros I made uses colors that are predetermined from the cells on excel, but...
    • The charts don't have the same splitting point (where the "Other slice occurs") for the second plot because the data sets don't have the same number of datums
    • The range for the chart is based off of what I select.
    If someone could help, or even have suggestions for a more efficient way to format this, it would be greatly appreciated. Below is what I have so far in VBA. Thank you!

     Sub BarofPieFillColor()
    '
    ' BarofPieFillColor Macro
    '
     Set SelectedCells = Selection
    '
        ActiveSheet.Shapes.AddChart.Select
        ActiveChart.ChartType = xlBarOfPie
        ActiveChart.SetSourceData Source:=SelectedCells, PlotBy:=xlColumns
        ActiveChart.ClearToMatchStyle
        ActiveChart.ChartStyle = 10
        ActiveChart.ClearToMatchStyle
        ActiveChart.SetElement (msoElementDataLabelCenter)
        ActiveChart.ApplyLayout (7)
        ActiveChart.ApplyDataLabels
        ActiveChart.SeriesCollection(1).DataLabels.Select
        ActiveChart.ChartGroups(1).SecondPlotSize = 200
        Selection.Position = xlLabelPositionCenter
        Selection.Separator = "; "
        Selection.ShowCategoryName = True
        Selection.ShowPercentage = True
        Selection.ShowValue = False
        Selection.Format.TextFrame2.TextRange.Font.Size = 14
        Selection.Format.TextFrame2.TextRange.Font.Bold = msoTrue
        Application.Run "PERSONAL.XLSB!ColorPies" <(using another macros I found online within this macros.)
        ActiveChart.PlotArea.Select
       
    End Sub
    Last edited by Hanaymous; 07-02-2014 at 02:04 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 08-07-2012, 03:54 PM
  2. Chart Colors
    By Coors in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 05-14-2008, 04:23 AM
  3. Bar Chart with 2 colors
    By Elden in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 11-27-2007, 05:27 PM
  4. Change Chart Bar or other Colors
    By sachinattri in forum Excel General
    Replies: 0
    Last Post: 03-24-2006, 07:36 AM
  5. [SOLVED] static colors in chart chart
    By Johan in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-22-2005, 09:05 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