View Full Version : Time exceptions within excel

02-09-2015, 04:15 AM
Cheers. First time posting.

I have an excel field (or series of fields) which have time-sensitive values. I am looking to reset these values at a particular time each day. Past data does not need to be documented as it is cleared.

Example: Cell G9 has a numeric value with a limited range (0,1,2,3 let's say). If this value is greater than 0, I would like the value to reset to 0 at a particular time (0600 PST). Any suggested on if/how this is possible? Any help would be greatly appreciated.

02-09-2015, 05:33 AM
Off the top.

In ThisWorkbook code module

Private Sub Workbook_Open()
Application.OnTime TimeSerial(6, 0, 0), "ResetValues"
End Sub

In a standard code module

Public Sub ResetValues()
ThisWorkbook.Worksheets("Sheet1").Range("G6").Value = 0
'any other cells as well
End Sub