Hi All!
I hope someone can please help me? I've got a very simple vba macro but it pauses when the window/sheet is not the active sheet??? Once I return to the Sheet where the macro is running it starts again??? I need to run this macro in the background so I can work on other excel workbooks. Is there a windows 10 security feature or something I need to turn on or off? Or is it the vba code. I can't find the answer on google.
I use 2 command buttons with the following code:
Thanks in advance for any help!!!
I hope someone can please help me? I've got a very simple vba macro but it pauses when the window/sheet is not the active sheet??? Once I return to the Sheet where the macro is running it starts again??? I need to run this macro in the background so I can work on other excel workbooks. Is there a windows 10 security feature or something I need to turn on or off? Or is it the vba code. I can't find the answer on google.
I use 2 command buttons with the following code:
Code:
Option ExplicitPublic dTime As Date
Sub ValueStore()
Dim dTime As Date
Dim nextRow As Long
'Calculate the row number once
nextRow = Cells(Rows.Count, "B").End(xlUp).Row + 1
Range("B" & nextRow).Value = Range("A1").Value
Call StartTimer
End Sub
Sub StartTimer()
dTime = Now + TimeValue("00:00:01")
Application.OnTime dTime, "ValueStore", Schedule:=True
End Sub
Sub StopTimer()
On Error Resume Next
Application.OnTime dTime, "ValueStore", Schedule:=False
End Sub
Thanks in advance for any help!!!