I need to modify this code, or perhaps try a different code.
I want the macro to move chart source data one cell to the right each time it runs. The source data needs to stay on the original columns and simply add one. For example, source data would be A1:E5 . Next time it runs, I want it to change to A1:F5, after that A1:G5, etc , etc.
s=activechart.SeriesCollection(1).formula
p1=instrrev(s,"!"
p2=instrrev(s,","
set cell=sheets("MyData"
.range(mid(s,p1+1,p2-p1-1)).offset(0,1)
activechart.SeriesCollection(1).formula=left(s,p1)+cell.address+mid(s,p2)
Thanks in advance!
I want the macro to move chart source data one cell to the right each time it runs. The source data needs to stay on the original columns and simply add one. For example, source data would be A1:E5 . Next time it runs, I want it to change to A1:F5, after that A1:G5, etc , etc.
s=activechart.SeriesCollection(1).formula
p1=instrrev(s,"!"
p2=instrrev(s,","
set cell=sheets("MyData"
activechart.SeriesCollection(1).formula=left(s,p1)+cell.address+mid(s,p2)
Thanks in advance!