Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default flashing screen

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default flashing screen

Hi

Put
Application.ScreenUpdating = False
OUTSIDE your Do - While loop.

HTH. best wishes Harald

"Paul" skrev i melding
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Screen flashing teepee[_3_] Excel Discussion (Misc queries) 0 November 26th 08 12:20 AM
How to stop the screen from 'flashing' when copying and pasting BaggieDan Excel Discussion (Misc queries) 4 October 9th 08 10:31 PM
Screen flashing why? Chet Excel Discussion (Misc queries) 1 May 16th 06 08:25 PM
Can I stop Excel program flashing on screen during run PJ[_4_] Excel Programming 3 July 7th 04 12:01 PM
flashing screen driving me bonkers! Deb Lang Excel Programming 1 October 30th 03 04:50 PM


All times are GMT +1. The time now is 06:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"