Need worksheet to refresh so Now() Function Calculates??

dhowser

New Member
Joined
Mar 29, 2002
Messages
30
I have a Worksheet that calculates the time people have been gone by subtracting the time they left from a cell with the Function Now() in it. I need to keep this list current without having to press F9 or entering information. Is there a way in Excel 97 to make this work??
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hi
Copy this code in your workbook class module.
Will fire a recalculation every ten seconds.
Edit as necc.
This little snippet of code will Calculate all open workbooks.
To change to a specific sheet or range.
Search VBA help for Calculate.

Have a nice day!
Tom
 
Upvote 0
Option Explicit
Dim I_Say_Stop

Private Sub Workbook_BeforeClose(Cancel As Boolean)
I_Say_Stop = True
End Sub

Private Sub Workbook_Open()
Dim Start


Start = Timer + 10
Do Until I_Say_Stop
Start = Timer + 10
Do While Timer< Start And I_Say_Stop = False
If Timer = 0 Then _
Start = Timer + 10
DoEvents
Loop
Calculate
Loop
End Sub
This message was edited by TsTom on 2002-03-30 07:38
 
Upvote 0
I inserted the text into the workbook code and it worked to begin with. I entered my info and the sheet re-calculated as expected. When I when to delete the info in a cell, I assume that it caused the timer loop to stop. What can I do to fix it??
 
Upvote 0
Hi
Sorry,
I should have tested it.
Are the =Now() formulas all entered in one column?
If so, which?
Is there anything else in that column?
I want to place a pause in your Before_DoubleClick event.
If a cell is double clicked the formula =Now() will be entered, if =now() is already in that cell, then it would be deleted.
Do you understand?
Will need to briefly disable Calculation when editing certain cells.
I tried to trap the error but could not.
Is generating an application defined error.
Not a VBA error?
I Emailed you
Tom
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top