We have a stacked bar graph that displays 26 4-week periods spanning
two years. The requesting department would like to differentiate the
colors on the bars for the past year from the colors on the bars for
the current year.

This is using Excel 2003. When I try to edit the colors for the graph
the color changes are manifest on all 26 bars. How can I apply some
VBA code to differentiate the between the first 13 bars for past
complete year and the final 13 bars for the current complete year?

The data resides on a hidden sheet, with the legends showing the date
of the quad-week (13 quad weeks in a year.) I recorded a macro for
changing the color but clearly need to differentiate between two
years.

Sub rebar()
'
' rebar Macro
'

'
ActiveSheet.Shapes("Chart 4").Select
ActiveSheet.ChartObjects("Chart 4").Activate
ActiveChart.Axes(xlCategory).Select
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
Selection.Shadow = False
Selection.InvertIfNegative = False
With Selection.Interior
.ColorIndex = 37
.Pattern = xlSolid
End With
ActiveChart.SeriesCollection(2).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
Selection.Shadow = False
Selection.InvertIfNegative = False
With Selection.Interior
.ColorIndex = 14
.Pattern = xlSolid
End With
End Sub

Thanks for all those that can help. We never say thank you enough.

 Sanford

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to