SetFocus Method Example

The following example uses the SetFocus method to move the focus to a particular member of the Windows collection; that is, it makes that window behave as if you had clicked its title bar with your mouse.

Application.VBE.Windows(9).SetFocus