I've produced a few macros now, by a combination of using recording and help from here, which all work ok, but I want to improve their "efficiency" by reducing the amount of activating and selecting during copying between workbooks. I've put together a simple macro just to try and work out the correct syntax, but am struggling to get it right.

The example has 3 workbooks, code.xls containing the macro, booka.xls containing some source data, and bookb.xls is the workbook to which I want to copy data, all in the same folder:

Sub CopyCells()

Dim wkbkFrom As Workbook
Dim wkbkTo As Workbook
Dim wksFrom As Worksheet
Dim wksTo As Worksheet
Dim MyPath As String
    
MyPath = Application.ActiveWorkbook.Path

Set wkbkFrom = Workbooks.Open(MyPath + "\booka.xls")
Set wkbkTo = Workbooks.Open(MyPath + "\bookb.xls")
Set wksFrom = wkbkFrom.Worksheets("Sheet3")
Set wksTo = wkbkTo.Worksheets("Sheet1")

'The above fails if the workbooks are already open

'
wksFrom.Range("A2:A21").Copy wksTo.Range("B2")
wksFrom.Range("B2:B21").Copy wksTo.Range("A2")


End Sub
This works ok.

However I want to get to the point where the macro is in booka.xls, and both booka.xls and bookb.xls are already open, with the correct sheets selected before the macro is run, but I can't get the right syntax for this. Obviously the Set wkbkFrom and Set wkbkTo lines fail because the workbooks are already open. I also think it should also be possible to lose the .Copy in the last two lines and use an =

It's the workbook and worksheet events (I think) that I'm struggling to understand their use.

If someone could give the correct coding, and maybe explain how it's actually working, I might start to understand it a bit more.