+ Reply to Thread
Results 1 to 7 of 7

Colors of columns after sorting data in the supporting table

  1. #1
    Booger_Boy
    Guest

    Colors of columns after sorting data in the supporting table

    When creating a chart off of a table, the colors of each column appear to be
    in the order of their display in the chart. For example, let's say I have
    January data as red, February data as white and March data as blue. Then I
    sort the table in the Excel sheet by value. Now the labels are ordered
    February, March, January. Well, now the first column (February) is red, the
    second (March) white and the third (January)blue.

    Is there a method to hard-code the column color to the data label in the
    charts rather than simply the order that the data appears?

  2. #2
    Brian Reilly, MS MVP
    Guest

    Re: Colors of columns after sorting data in the supporting table

    I'm about to do this on a project where I want consistent colors by
    "Brand Name" and I plan to use a VBA routine and a Select Case
    statement on the "Brand Name" text and then apply the correct color
    index. You just have to iterate throught the datapoints.

    Brian Reilly, PowerPoint MVP

  3. #3
    Jon Peltier
    Guest

    Re: Colors of columns after sorting data in the supporting table

    BB -

    You might be able to make a conditional chart with your data:

    http://peltiertech.com/Excel/Charts/...nalChart1.html

    It will cost you a few extra columns and some formulas, but it is dynamic as the
    data changes, whereas the VBA procedure would have to be rerun.

    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Peltier Technical Services
    Tutorials and Custom Solutions
    http://PeltierTech.com/
    _______

    Booger_Boy wrote:

    > When creating a chart off of a table, the colors of each column appear to be
    > in the order of their display in the chart. For example, let's say I have
    > January data as red, February data as white and March data as blue. Then I
    > sort the table in the Excel sheet by value. Now the labels are ordered
    > February, March, January. Well, now the first column (February) is red, the
    > second (March) white and the third (January)blue.
    >
    > Is there a method to hard-code the column color to the data label in the
    > charts rather than simply the order that the data appears?



  4. #4
    Andy Pope
    Guest

    Re: Colors of columns after sorting data in the supporting table

    Hi,

    Depending on the complexity you may be able to use a conditional chart.
    http://www.andypope.info/ngs/ng32.htm

    Although the data layout technique will work in MSGraph it would not be
    dynamic unless you used some VBA code.

    Cheers
    Andy

    Brian Reilly, MS MVP wrote:
    > I'm about to do this on a project where I want consistent colors by
    > "Brand Name" and I plan to use a VBA routine and a Select Case
    > statement on the "Brand Name" text and then apply the correct color
    > index. You just have to iterate throught the datapoints.
    >
    > Brian Reilly, PowerPoint MVP


    --

    Andy Pope, Microsoft MVP - Excel
    http://www.andypope.info

  5. #5
    brian@nothere_reillyand.com
    Guest

    Re: Colors of columns after sorting data in the supporting table

    Hi Andy,
    Could do this with conditional formattting as you and Jon say. Would
    want to think about it in MS Grump, heck, wouldn't even use MS Grump
    unless a shotgun was pointed at my head, and I'd probably get it wrong
    even then.

    Seems to me that if one has lots of charts across many presentations
    that I'd be a whole heap better off by just having a Private Sub that
    gets called from a table drivern thing. Sub stays the same always and
    the user maintains the Table, in where else some worksheet(s)
    somewhere and we just read the variables each time and spit them at
    the Private Sub routine. Kinda table driven programming like Rob Bovey
    taught me to like and endorse.

    Brian Reilly, PowerPoint MVP

    On Sat, 22 Jan 2005 15:31:40 +0000, Andy Pope <[email protected]>
    wrote:

    >Hi,
    >
    >Depending on the complexity you may be able to use a conditional chart.
    >http://www.andypope.info/ngs/ng32.htm
    >
    >Although the data layout technique will work in MSGraph it would not be
    >dynamic unless you used some VBA code.
    >
    >Cheers
    >Andy
    >
    >Brian Reilly, MS MVP wrote:
    >> I'm about to do this on a project where I want consistent colors by
    >> "Brand Name" and I plan to use a VBA routine and a Select Case
    >> statement on the "Brand Name" text and then apply the correct color
    >> index. You just have to iterate throught the datapoints.
    >>
    >> Brian Reilly, PowerPoint MVP



  6. #6
    Andy Pope
    Guest

    Re: Colors of columns after sorting data in the supporting table

    Hi Brian,

    If you can use VBA then it will certainly be easier to apply changes to
    many charts.

    Cheers
    Andy

    brian@nothere_reillyand.com wrote:
    > Hi Andy,
    > Could do this with conditional formattting as you and Jon say. Would
    > want to think about it in MS Grump, heck, wouldn't even use MS Grump
    > unless a shotgun was pointed at my head, and I'd probably get it wrong
    > even then.
    >
    > Seems to me that if one has lots of charts across many presentations
    > that I'd be a whole heap better off by just having a Private Sub that
    > gets called from a table drivern thing. Sub stays the same always and
    > the user maintains the Table, in where else some worksheet(s)
    > somewhere and we just read the variables each time and spit them at
    > the Private Sub routine. Kinda table driven programming like Rob Bovey
    > taught me to like and endorse.
    >
    > Brian Reilly, PowerPoint MVP
    >
    > On Sat, 22 Jan 2005 15:31:40 +0000, Andy Pope <[email protected]>
    > wrote:
    >
    >
    >>Hi,
    >>
    >>Depending on the complexity you may be able to use a conditional chart.
    >>http://www.andypope.info/ngs/ng32.htm
    >>
    >>Although the data layout technique will work in MSGraph it would not be
    >>dynamic unless you used some VBA code.
    >>
    >>Cheers
    >>Andy
    >>
    >>Brian Reilly, MS MVP wrote:
    >>
    >>>I'm about to do this on a project where I want consistent colors by
    >>>"Brand Name" and I plan to use a VBA routine and a Select Case
    >>>statement on the "Brand Name" text and then apply the correct color
    >>>index. You just have to iterate throught the datapoints.
    >>>
    >>>Brian Reilly, PowerPoint MVP

    >
    >


    --

    Andy Pope, Microsoft MVP - Excel
    http://www.andypope.info

  7. #7
    Booger_Boy
    Guest

    Re: Colors of columns after sorting data in the supporting table

    Most excellent! Thanks for your assistance.

    I wasn't about to delve into VBA code, which I have found to be mind-numbing
    in the past.

    -BB.

    "Andy Pope" wrote:

    > Hi,
    >
    > Depending on the complexity you may be able to use a conditional chart.
    > http://www.andypope.info/ngs/ng32.htm
    >
    > Although the data layout technique will work in MSGraph it would not be
    > dynamic unless you used some VBA code.
    >
    > Cheers
    > Andy
    >
    > Brian Reilly, MS MVP wrote:
    > > I'm about to do this on a project where I want consistent colors by
    > > "Brand Name" and I plan to use a VBA routine and a Select Case
    > > statement on the "Brand Name" text and then apply the correct color
    > > index. You just have to iterate throught the datapoints.
    > >
    > > Brian Reilly, PowerPoint MVP

    >
    > --
    >
    > Andy Pope, Microsoft MVP - Excel
    > http://www.andypope.info
    >


+ 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