excel - VBA: Loop through different tabs(Charts) to refresh & change the data range -
so gods of vba, require assistance!
i need macro runs through 80 tabs, each of them containing single chart plots % vs time.
the data plots refer contained in tab; these data scarcely populated (there empty spaces between them) , updated; new lines added in upper part of spreadsheet , measurements reported. of course charts won't update automatically require macro (so far not complicated) far had 1 macro refreshed data range on whole range, , 1 "switch view" last year. thing new columns might added data , in between them, makes fixed ranged referencing useless changed...
this it's how has been done until today:
sheets("bh1").select activechart.seriescollection(1).xvalues = "='sk'!$c$11:$c$130" activechart.seriescollection(1).values = "='sk'!$d$11:$d$130" sheets("bh2").select activechart.seriescollection(1).xvalues = "='sk'!$f$11:$f$130" activechart.seriescollection(1).values = "='sk'!$g$11:$g$130"
and on other tabs (bh1 chart, bh2 , on) the plot of last year; have plot on whole time period other macro differed in:
sheets("bh1").select activechart.seriescollection(1).xvalues = "='sk'!$c$11:$c$630" activechart.seriescollection(1).values = "='sk'!$d$11:$d$630"
now kind of approach prefer avoid because once move data of bh1 (which might happen when insert new source of data) whole macro becomes kinda useless..
this a snap of how tab containing data looks like give maybe better idea.
Comments
Post a Comment