Am messing around with Timed reporting in a workbook. I.E. every half an hour vba code runs to collect current volumes processed in a workbook. The issue I have is trying to figure out how I can have the code to run & either one of two solutions 1) Stay in the current cell when Code runs. 2) Return to the cell when code run is complete.
In Private Sub workbook Open have the following code (sample)
Application.OnTime TimeValue("06:00:00"), "Volume_Update1"
Application.OnTime TimeValue("06:30:00"), "Volume_Update2"
Application.OnTime TimeValue("07:00:00"), "Volume_Update3"
This calls the Volume_Update1 at 6:00 and on to the next time event. Below is a sample of this...
Sub Volume_Update1()
'Dim PrevCell As Range - Need help with this Previous Cell code....
'Set PrevCell = ActiveCell
'ActiveSheet.Protect UserInterFaceOnly:=True
Application.ScreenUpdating = False
Sheets("TrackSheet").Select
Range("K1").Select
Selection.Copy
Range("B3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'PrevCell.Select -
Application.ScreenUpdating = True
End Sub
Help appreciated
In Private Sub workbook Open have the following code (sample)
Application.OnTime TimeValue("06:00:00"), "Volume_Update1"
Application.OnTime TimeValue("06:30:00"), "Volume_Update2"
Application.OnTime TimeValue("07:00:00"), "Volume_Update3"
This calls the Volume_Update1 at 6:00 and on to the next time event. Below is a sample of this...
Sub Volume_Update1()
'Dim PrevCell As Range - Need help with this Previous Cell code....
'Set PrevCell = ActiveCell
'ActiveSheet.Protect UserInterFaceOnly:=True
Application.ScreenUpdating = False
Sheets("TrackSheet").Select
Range("K1").Select
Selection.Copy
Range("B3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'PrevCell.Select -
Application.ScreenUpdating = True
End Sub
Help appreciated