ActiveCodePane Property
Returns the active or last active CodePane object or sets the active CodePane object. Read/write.
Remarks
You can set the ActiveCodePane property to any valid CodePane object, as shown in the following example:
Set MyApp.VBE.ActiveCodePane = MyApp.VBE.CodePanes(1)
The preceding example sets the first code pane in a collection of code panes to be the active code pane. You can also activate a code pane using the Set method.