Refresh My data view in VB

  • Thread starter Thread starter RossK
  • Start date Start date
R

RossK

I'm having trouble making visual basic very visual! :)

I'd like to create a visually updating view of some data. So my visual
basic macro goes off and grabs an array full of data, it fills some cells
on a page with that data, then it goes off and gets some more and refills
the cells.

I'd like to see the cells change each time (a bit of delaying will likely
be required, tweaking to the desired speed ).

What happens is the macro goes off, processes all the data fetches from
the raw data sheet, and finishes. The screen updates only once (after
several seconds) showing me the final write of data into my display area.

I'd like to make it refresh the display after every fetch/write cycle.
Is there a command to do this? (Not having much luck finding such a thing
in the help)


Thanks for any suggestions....

Ross.
 
Ross

See Chip Pearson's site for Application.OnTime coding.

You can set an interval of a few seconds(or more) between your copy and paste
routine.

Example only from Chip's site..........

Public RunWhen As Double
Public Const cRunIntervalSeconds = 10 '10 seconds
Public Const cRunWhat = "The_Sub"

Sub StartTimer()
RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime earliesttime:=RunWhen, procedure:=cRunWhat, _
schedule:=True
End Sub

Sub The_Sub()
Sheets("Sheet1").Range("A1:G23").Copy _
Destination:=Sheets("Sheet2").Range("A1")
StartTimer
End Sub

Use Chip's StopTimer code to stop when you want.

Gord Dibben Excel MVP
 
Back
Top