+ Reply to Thread
Results 1 to 3 of 3

flashing screen

  1. #1
    Paul
    Guest

    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. #2
    Harald Staff
    Guest

    Re: flashing screen

    Hi

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

    HTH. best wishes Harald

    "Paul" <[email protected]> skrev i melding
    news:[email protected]...
    > 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. #3
    Tom Ogilvy
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1