The Code window is found to the right of the Project Explorer. It displays the VBA code for the object currently highlighted in the Project Explorer.

If the Code window is not visible when you open the Microsoft Visual Basic window, you can make it visible by selecting Code under the View menu.

module code 1

In the example below, the VBA code is displayed for the module called Module1.

module code 2

Immediate Window >