ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Animated charts showing change with time (https://www.excelbanter.com/excel-programming/307142-animated-charts-showing-change-time.html)

stephenm

Animated charts showing change with time
 
I have an xy chart and want to look through all the different datasets
for it to show animated change over time.

I really need a way to make a for/while loop which will loop through
from say J5:U5 to J100:U100.
I have tried to use a variable to input in for the range and use the
replace command to keep updating it, one at a time. but no luck
Here is the kind of code i need to be able to generate with the loop.
Any insight into how i could solve this would be helpful

Thanks
Stephen



Timedelay

ActiveChart.SetSourceData Source:=Sheets("IQAF").Range("J2:U2,J5:U5"),
PlotBy:=xlRows

Timedelay

ActiveChart.SetSourceData Source:=Sheets("IQAF").Range("J2:U2,J6:U6"),
PlotBy:=xlRows

Timedelay

ActiveChart.SetSourceData Source:=Sheets("IQAF").Range("J2:U2,J7:U7"),
PlotBy:=xlRows

....
....
....
....

Tom Ogilvy

Animated charts showing change with time
 
for i = 5 to 100
ActiveChart.SetSourceData Source:=Sheets("IQAF").Range("J2:U2,J" & _
i & ":U" & i), PlotBy:=xlRows
Application.Calculate
Wait Now + timevalue("0:0:10")
Next i

--
Regards,
Tom Ogilvy


"stephenm" wrote in message
om...
I have an xy chart and want to look through all the different datasets
for it to show animated change over time.

I really need a way to make a for/while loop which will loop through
from say J5:U5 to J100:U100.
I have tried to use a variable to input in for the range and use the
replace command to keep updating it, one at a time. but no luck
Here is the kind of code i need to be able to generate with the loop.
Any insight into how i could solve this would be helpful

Thanks
Stephen



Timedelay

ActiveChart.SetSourceData Source:=Sheets("IQAF").Range("J2:U2,J5:U5"),
PlotBy:=xlRows

Timedelay

ActiveChart.SetSourceData Source:=Sheets("IQAF").Range("J2:U2,J6:U6"),
PlotBy:=xlRows

Timedelay

ActiveChart.SetSourceData Source:=Sheets("IQAF").Range("J2:U2,J7:U7"),
PlotBy:=xlRows

...
...
...
...





All times are GMT +1. The time now is 12:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com