N
neowok
i have a pivottable and chart based on it and it would be very useful i
i could make the table automatically change its source range to includ
any new rows added to the source table.
at the moment ive got the chart updating whenever the chart sheet i
activated, so ideally i would simply put code to update the pivottabl
with any extra rows just above this.
basicallly i want it to pick up all non blank rows from 4 down t
wherever the end of the table is, without me having to go into th
pivottable properties and changing the source every time i add a ne
row to the source table.
the other thing is i have colour the bars on the chart based on wha
data each bar is, but sometimes some of the bars will have no data an
so not appear in the chart, which screws up my code for assigning th
colours. what i need is code that will go from the first data serie
to whatever the last one happens to be, then inside this loop check th
name of the data series. i can then colour the bars by name. the cod
ive got colouring them at the moment is like:
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).Points(1).Select
ActiveChart.SeriesCollection(1).Points(1).ApplyDataLabel
ShowValue:=True
With Selection.Interior
.ColorIndex = 39
End With
ActiveChart.SeriesCollection(1).Points(2).Select
ActiveChart.SeriesCollection(1).Points(2).ApplyDataLabel
ShowValue:=True
With Selection.Interior
.ColorIndex = 39
End With
theres up to 14 'points' but there might sometimes only be say 6, an
so the code would then break when trying to assign a colour to number
unless it only colours inside a loop that does something like wit
points(1) to points(last) if points.name=("my text") then .colorindex
mycolour"
i just dont know the exact code to do thi
i could make the table automatically change its source range to includ
any new rows added to the source table.
at the moment ive got the chart updating whenever the chart sheet i
activated, so ideally i would simply put code to update the pivottabl
with any extra rows just above this.
basicallly i want it to pick up all non blank rows from 4 down t
wherever the end of the table is, without me having to go into th
pivottable properties and changing the source every time i add a ne
row to the source table.
the other thing is i have colour the bars on the chart based on wha
data each bar is, but sometimes some of the bars will have no data an
so not appear in the chart, which screws up my code for assigning th
colours. what i need is code that will go from the first data serie
to whatever the last one happens to be, then inside this loop check th
name of the data series. i can then colour the bars by name. the cod
ive got colouring them at the moment is like:
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).Points(1).Select
ActiveChart.SeriesCollection(1).Points(1).ApplyDataLabel
ShowValue:=True
With Selection.Interior
.ColorIndex = 39
End With
ActiveChart.SeriesCollection(1).Points(2).Select
ActiveChart.SeriesCollection(1).Points(2).ApplyDataLabel
ShowValue:=True
With Selection.Interior
.ColorIndex = 39
End With
theres up to 14 'points' but there might sometimes only be say 6, an
so the code would then break when trying to assign a colour to number
unless it only colours inside a loop that does something like wit
points(1) to points(last) if points.name=("my text") then .colorindex
mycolour"
i just dont know the exact code to do thi