When the below macro runs every 5 min, no matter on which Sheet I'm working, it just always comes/shifts to Sheet2.
I'm aware that .select in my code might be responsible for it, but is there any other way to write the below code or anything that can prevent from shifting and keep myself working on the sheet where I'm working.
It is very frustrating to change to another sheet every 5 min of 4-5 working hours on it.
I used (but no result)
Application.ScreenUpdating = False
My macro code here
Application.ScreenUpdating = True
What my macro does?
It copies data from some cells of Sheet1 Pic1 and paste them in list wise every 5 min in Sheet2 Pic2
My macro code
Sub Macro5()
'Code for running it every 5 min
Application.OnTime Now + TimeValue("00:05:00"), "Macro5", True
'Go to sheet1
Sheets ("Sheet1").Select
'Select some cell
Range ("A1:D1").Select
'Go down with CTRL + ↓
Selection. End (xlDown).Select
'Select 1 cell down using relative reference
ActiveCell.offset (1, 0).Range ("A1").Select
'Come to sheet2
Sheets ("Sheet2").Select
'Select some cells
Range ("I4:L4").Select
'Copy selected cells
Selection.Copy
'Come to sheet1
Sheets ("Sheet1").Select
'Paste that selected value in some cells of sheet 1
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _ xlNone, SkipBlanks:=False, Transpose:=False
End Sub
*There might be some spelling error in the macro but avoid it, as the original macro runs perfectly on my PC