Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2
Default Changing color of single bar based on x-axis date value

I have a bar chart with numeric values for the y-axis, and Month-Year
values for the x-axis values. I would like to be able to use VBA to
change the color of just one of the bars whose x-axis value corresponds
to a specific month-year, like Jun-05 (The month-year could be text, if
that makes the example easier). Does anyone have a snippet of code that
would allow me to automate the coloring of just one bar based on the
x-axis value?

Thanks,

Carroll Rinehart
Bel Air, MD

  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Changing color of single bar based on x-axis date value

You don't need VBA; you can make a conditional chart using one or more extra
series:

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

If you want to use VBA for some other reason, you could adjust the last
couple macros in this article (it's about pie charts, but the macros
shouldn't care):

http://pubs.logicalexpressions.com/P...cle.asp?ID=390

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


wrote in message
ups.com...
I have a bar chart with numeric values for the y-axis, and Month-Year
values for the x-axis values. I would like to be able to use VBA to
change the color of just one of the bars whose x-axis value corresponds
to a specific month-year, like Jun-05 (The month-year could be text, if
that makes the example easier). Does anyone have a snippet of code that
would allow me to automate the coloring of just one bar based on the
x-axis value?

Thanks,

Carroll Rinehart
Bel Air, MD



  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2
Default Changing color of single bar based on x-axis date value

Thanks Jon for taking the time to provide more than one solution.

Carroll

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Determining Date X based on Other dates MIchel Khennafi Excel Worksheet Functions 1 May 3rd 06 04:45 PM
Finding the Monday date based on a different date in same week dandiehl Excel Worksheet Functions 4 April 11th 06 06:03 PM
Subtract a group of cells from a total based on ending date Nicholas Scarpinato Excel Discussion (Misc queries) 0 May 17th 05 03:25 PM
Changing Cell formats to date fields automatically PCLIVE Excel Worksheet Functions 3 April 12th 05 10:34 PM
Chart Date X Axis MrC Charts and Charting in Excel 2 February 8th 05 07:52 PM


All times are GMT +1. The time now is 11:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"