excel - series deletion in chart -
i have table , generate chart out of it. problem have column values of a, f, g, , h.
i tried seriescollection(1).deletion method,. still getting column b , c series in chart.
could tell me how can it. lead helpful
sub chartstatus() dim rng range dim cht object set rng = activesheet.range("a2:h53") thisworkbook.sheets("status").chartobjects.delete set sh = activesheet.chartobjects.add(left:=650, _ width:=600, _ top:=80, _ height:=250) sh.select set cht = activechart cht .setsourcedata source:=rng .charttype = xlcolumnclustered cht.axes(xlsecondary).ticklabels.numberformat = "0.%" end cht.seriescollection(6).name = " % missing " cht.seriescollection(7).name = " % ontime" cht.seriescollection(8).name = " % delayed" cht.seriescollection(6).hasdatalabels = true cht.seriescollection(7).hasdatalabels = true cht.seriescollection(8).hasdatalabels = true cht.seriescollection(1).format.fill.forecolor.rgb = rgb(255, 255, 255) '<~~ red cht.hastitle = true cht.charttitle.text = "result " end sub
you can combine 2 range 1 range
dim rng range dim rng_a range dim rng_fh range set rng_a = activesheet.range("a2:a52") set rng_fh = activesheet.range("f2:h52") set rng = union(rng_a, rng_fh)
Comments
Post a Comment