Changing bar colors in bar graph - VBA Excel 2007 -


i've created vba excel 2007 program automatically creates bar graphs roi based on 52 different tabs in active workbook. i'm close done, , only thing cannot figure out how change colors of bargraphs.

the graphs created in own subfunction, called call so. every variable changes around whenever it's called.

call addchartobject(1, 1, "example", extraweeks, weekdifference) 

my sub calls looks this.

sub addchartobject(j integer, k integer, passedcharttitle string, xtrawks integer, ttlwks integer)      dim topofchart integer      topofchart = 25 + (350 * j)      'adds bar chart total sales      activesheet.chartobjects.add(left:=375, width:=475, top:=topofchart, height:=325)         .chart.setsourcedata source:=sheets("consolidation").range("$a$" & 3 + ((17 + xtrawks) _             * j) & ":$c$" & (4 + ttlwks) + ((17 + xtrawks) * k))         .chart.charttype = xl3dcolumnclustered         .chart.setelement (msoelementdatalabelshow)         .chart.hastitle = true         .chart.charttitle.text = passedcharttitle & " sales"         .chart.setelement (msoelementlegendbottom)         .chart.setelement (msoelementdatalabelnone)         .chart.rightangleaxes = true     end  end sub 

the rgb color want use on second series in bar chart (155, 187, 89), per marketing's wishes. i'm pretty sure there .chart.????.???? = rgb (155, 187,89) command can use in set this, have spent far time trying figure out, come nothing.

thanks help!

@scottystyles:

have tried

.chart.seriescollection([index]).interior.color = rgb(155, 187, 89) 

(where [index] placeholder series want change color for)?


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -