Good morning everybody,
I have set up a sheet which collects various different types of data throughout the day. At the end of each day, once everybody has gone home, I want a macro to run which then collates all this data and set up the sheet again for the next day. Mdusoe helped me with the following piece of code which runs 'Mymacro' at a preset time located in cell A1...
Public oldTime As Double
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
If oldTime > 0 Then
On Error Resume Next
Application.OnTime oldTime, "MyMacro", , False
On Error Goto 0
End If
oldTime = [A1]
Application.OnTime [A1], "MyMacro"
End If
End Sub
This works fine.....sometimes. Unfortunately it has proved to be unreliable, running some nights and not others. Is this something to do with the way excel refreshes the time and can anything be done to make this more reliable?
Thanks.
I have set up a sheet which collects various different types of data throughout the day. At the end of each day, once everybody has gone home, I want a macro to run which then collates all this data and set up the sheet again for the next day. Mdusoe helped me with the following piece of code which runs 'Mymacro' at a preset time located in cell A1...
Public oldTime As Double
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
If oldTime > 0 Then
On Error Resume Next
Application.OnTime oldTime, "MyMacro", , False
On Error Goto 0
End If
oldTime = [A1]
Application.OnTime [A1], "MyMacro"
End If
End Sub
This works fine.....sometimes. Unfortunately it has proved to be unreliable, running some nights and not others. Is this something to do with the way excel refreshes the time and can anything be done to make this more reliable?
Thanks.