ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do i get an automatic refresh of a worksheet in excel (https://www.excelbanter.com/excel-worksheet-functions/189552-how-do-i-get-automatic-refresh-worksheet-excel.html)

dan

How do i get an automatic refresh of a worksheet in excel
 
I have a 2007 Excel worksheet that uses time that is updated to get
information for other cells. Rather than continuously hit the F9 key. I
would like to set an automatic refresh every 20 seconds or so.

Gary''s Student

How do i get an automatic refresh of a worksheet in excel
 
Insert the following in a standard module:

Public RunWhen As Double
Public Const cRunIntervalSeconds = 20
Public Const cRunWhat = "The_Sub"
Public Const a = "a"

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

Sub The_Sub()
Calculate
StartTimer
End Sub

Sub StopTimer()
On Error Resume Next
Application.OnTime earliesttime:=RunWhen, _
procedu=cRunWhat, schedule:=False
End Sub


and then run the StartTimer macro.
--
Gary''s Student - gsnu200789


"Dan" wrote:

I have a 2007 Excel worksheet that uses time that is updated to get
information for other cells. Rather than continuously hit the F9 key. I
would like to set an automatic refresh every 20 seconds or so.


dan

How do i get an automatic refresh of a worksheet in excel
 
Thank you so much....Works perfectly....

"Gary''s Student" wrote:

Insert the following in a standard module:

Public RunWhen As Double
Public Const cRunIntervalSeconds = 20
Public Const cRunWhat = "The_Sub"
Public Const a = "a"

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

Sub The_Sub()
Calculate
StartTimer
End Sub

Sub StopTimer()
On Error Resume Next
Application.OnTime earliesttime:=RunWhen, _
procedu=cRunWhat, schedule:=False
End Sub


and then run the StartTimer macro.
--
Gary''s Student - gsnu200789


"Dan" wrote:

I have a 2007 Excel worksheet that uses time that is updated to get
information for other cells. Rather than continuously hit the F9 key. I
would like to set an automatic refresh every 20 seconds or so.


dan

How do i get an automatic refresh of a worksheet in excel
 
YOU answered my dilema perfectly, Thank you.

"Gary''s Student" wrote:

Insert the following in a standard module:

Public RunWhen As Double
Public Const cRunIntervalSeconds = 20
Public Const cRunWhat = "The_Sub"
Public Const a = "a"

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

Sub The_Sub()
Calculate
StartTimer
End Sub

Sub StopTimer()
On Error Resume Next
Application.OnTime earliesttime:=RunWhen, _
procedu=cRunWhat, schedule:=False
End Sub


and then run the StartTimer macro.
--
Gary''s Student - gsnu200789


"Dan" wrote:

I have a 2007 Excel worksheet that uses time that is updated to get
information for other cells. Rather than continuously hit the F9 key. I
would like to set an automatic refresh every 20 seconds or so.


Gary''s Student

How do i get an automatic refresh of a worksheet in excel
 
Glad to help. Have a good weekend!!
--
Gary''s Student - gsnu200789


"Dan" wrote:

YOU answered my dilema perfectly, Thank you.

"Gary''s Student" wrote:

Insert the following in a standard module:

Public RunWhen As Double
Public Const cRunIntervalSeconds = 20
Public Const cRunWhat = "The_Sub"
Public Const a = "a"

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

Sub The_Sub()
Calculate
StartTimer
End Sub

Sub StopTimer()
On Error Resume Next
Application.OnTime earliesttime:=RunWhen, _
procedu=cRunWhat, schedule:=False
End Sub


and then run the StartTimer macro.
--
Gary''s Student - gsnu200789


"Dan" wrote:

I have a 2007 Excel worksheet that uses time that is updated to get
information for other cells. Rather than continuously hit the F9 key. I
would like to set an automatic refresh every 20 seconds or so.



All times are GMT +1. The time now is 10:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com