Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
dan dan is offline
external usenet poster
 
Posts: 866
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
dan dan is offline
external usenet poster
 
Posts: 866
Default 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.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
dan dan is offline
external usenet poster
 
Posts: 866
Default 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.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default 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.

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
Data import from different excel files & automatic refresh Aspa Excel Discussion (Misc queries) 0 April 23rd 08 09:30 AM
Create refresh button in worksheet to refresh Pivot Table Data Ron Excel Worksheet Functions 1 October 13th 07 01:20 AM
How can I 'Enable Automatic Refresh' for Query Refresh by default Anand Deshpande Setting up and Configuration of Excel 0 December 10th 06 04:47 AM
Automatic refresh (F9) in excel ???? Andy100 New Users to Excel 3 October 4th 05 04:57 PM
Query Refresh-Enable Automatic Refresh Dialogue Box Terri Excel Discussion (Misc queries) 0 May 6th 05 08:21 PM


All times are GMT +1. The time now is 02:43 PM.

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

About Us

"It's about Microsoft Excel"