I have made an excel workbook for my trading , it has lots of sheets and each sheet has a certain purpose.It also has many macros that I learnt to make for over a year . Anyways I have done the hardest part , and only one simple thing that I can't find the answer anywhere on the net !! simply I have a macro that copies certain cells and paste them on another cell , and there is a timer so that the copy paste macro runs automatically every minute lets say .Problem is that after it runs , it will stay on the last sheet where values are pasted and I dont want that because I will have to go manually and press on the last sheet I was working on .
This is the code :
Sub EnergyON()
Application.OnTime Now + TimeValue("00:01:00"), "EnergyOn"
Sheets("dde").Select
Range("B1:B7").Select
Selection.Copy
Sheets("currencies").Select
Range("B3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
so as this code runs every minute, it copies cells B1 to B7 from sheet "dde" and pastes them on sheet "currencies" . But meanwhile I was working lets say on Sheet1 or Sheet2 or Sheet3 or even any other sheet , I find myself taken to sheet "currencies" every minute and therefore I have to press on the tab of the last sheet i was working on to get back to my work . Is there any line I can add to this simple macro to make this happen ?? thank you very much