View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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

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