Hey,
I've been lurking the forums and the web but have yet to find how to solve this..
The code as it stands looks like this, in a module:
Sub my_Procedure()
Dim lRow As Long
Worksheets("MarketTrack").Activate
lRow = Worksheets("MarketTrack").Range("D" & Rows.Count).End(xlUp).Row
Worksheets("MarketTrack").Range("B" & lRow + 1).Value = CDate(Format(Now, "hh:mm"))
Worksheets("MarketTrack").Range("D" & lRow + 1).Value = Worksheets("MarketTrack").Range("D9").Value
Worksheets("MarketTrack").Range("F" & lRow + 1).Value = Worksheets("MarketTrack").Range("F9").Value
Worksheets("MarketTrack").Range("H" & lRow + 1).Value = Worksheets("MarketTrack").Range("H9").Value
Worksheets("MarketTrack").Range("J" & lRow + 1).Value = Worksheets("MarketTrack").Range("J9").Value
Worksheets("MarketTrack").Range("L" & lRow + 1).Value = Worksheets("MarketTrack").Range("L9").Value
Worksheets("MarketTrack").Range("N" & lRow + 1).Value = Worksheets("MarketTrack").Range("N9").Value
Call timer 'starting timer again
End Sub
Sub timer()
Application.OnTime Now + TimeValue("00:01:00"), "my_Procedure"
End Sub
This works as long as my MarketTracker.xlsm/MarketTrack(sheet) is in focus, though as-soon-as I change of workbook it throws me an error "out-of-range" (I'm assuming it's because the macro is trying to run the My_Procedure but it's no longer in the right place...) That said, all my workbooks (excel-files) are open at all times.
Is there a way to get the Macro to always run on a specific workbook/worksheet in the background?
Thanks for your time!
Bookmarks