Thread: flashing screen
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default flashing screen

Sub xdayplayer()

Dim counter As Long
Dim begin As Long
Dim ending As Long
Dim cent As Long
'
Application.ScreenUpdating = False
Do

counter = Worksheets("DATA").[ah1].Value

begin = counter + 1
ending = counter + 781
cent = ending - 100
counter = counter + 1
Worksheets("DATA").[ah1].Value = counter



ActiveSheet.ChartObjects("Chart 21").Activate
ActiveChart.SeriesCollection(1).Values = "=DATA!R" &
cent & "C13:R" & ending & "C13"
ActiveChart.SeriesCollection(2).Values = "=DATA!R" &
cent & "C20:R" & ending & "C20"


ActiveSheet.ChartObjects("Chart 18").Activate
ActiveChart.SeriesCollection(1).Values = "=DATA!R" &
begin & "C17:R" & ending & "C17"
ActiveChart.SeriesCollection(2).Values = "=DATA!R" &
begin & "C24:R" & ending & "C24"



Loop While counter < 10000
Application.ScreenUpdating = True
End Sub

--
Regards,
Tom Ogilvy

"Paul" wrote in message
...
I have written the following code which displays a moving
series of data in a couple of charts. It works, but
there is a lot of flashing and flickering while it is
running. Can someone tell me how to eliminate the screen
flashing??

Sub xdayplayer()

Dim counter As Long
Dim begin As Long
Dim ending As Long
Dim cent As Long
'
Do

counter = Worksheets("DATA").[ah1].Value

begin = counter + 1
ending = counter + 781
cent = ending - 100
counter = counter + 1
Worksheets("DATA").[ah1].Value = counter

Application.ScreenUpdating = False

ActiveSheet.ChartObjects("Chart 21").Activate
ActiveChart.SeriesCollection(1).Values = "=DATA!R" &
cent & "C13:R" & ending & "C13"
ActiveChart.SeriesCollection(2).Values = "=DATA!R" &
cent & "C20:R" & ending & "C20"


ActiveSheet.ChartObjects("Chart 18").Activate
ActiveChart.SeriesCollection(1).Values = "=DATA!R" &
begin & "C17:R" & ending & "C17"
ActiveChart.SeriesCollection(2).Values = "=DATA!R" &
begin & "C24:R" & ending & "C24"

Application.ScreenUpdating = True

Loop While counter < 10000

End Sub