If you have trouble with the docking of the different VBE windows,
you can restore their positions by editing a setting in the Registry.
Note! Back up the Registry before you edit it.
WARNING: Using Registry Editor incorrectly can cause serious problems that may require
you to reinstall your operating system. Use Registry Editor at your own risk.
Close Excel and the VBE.
Navigate to HKEY_USERS\.Default\Software\Microsoft\VBA\Office.
Rename (or delete) the value Dock (e.g. ;Dock), Excel will recreate it when it starts next time.
Open Excel and VBE, the windows are now at their default positions.