Results 1 to 2 of 2

Thread: Topic 37: Visual Basic Editor - Getting Started to Know the Excel VBA Feature

  1. #1
    Administrator
    Join Date
    Oct 2009
    Posts
    5,607
    Rep Power
    10

    Topic 37: Visual Basic Editor - Getting Started to Know the Excel VBA Feature

    Advertisement

    To start the editor, open an Excel file that contains macros. Then, click the Tools menu, point to Macro and click on Visual Basic Editor.


    The Editor contains two important windows: the Project Explorer and the Code window.

    1) The Project Explorer
    The Project Explorer located at the left hand side of the editor screen. It displays a hierarchical list of the projects and all of the items contained in and referenced by each of the projects. From the Project Explorer, it contains several elements:

    • VBAProject - the name of an open workbook.
    Advertisement

    - Microsoft Excel Objects: The worksheets and chartsheets contained in the VBAProject. The event procedures for each sheet and the workbook are stored here.
    - Forms: any user defined forms.
    - Modules: recorded and written procedures.

  2. #2
    Administrator
    Join Date
    Oct 2009
    Posts
    5,607
    Rep Power
    10
    2) The Code Window

    Use the Code window located at the right hand side of the editor screen enables you to write, display and edit Visual Basic code. To open a Code window from the Project Explorer window, just double-click on a form or module in the Project Explorer. You can highlight and drag the selected text to a different location in the current Code window or to another Code window.

    Here are the components on the code window:

    • Procedures/Events Box

    Lists all the events recognised by Visual Basic for a form or control displayed in the Object box. When an event is selected, the event procedure associated with that event name is displayed in the Code window.

    If (General) is displayed in the Object box, the Procedure box lists any declarations and all of the general procedures that have been created for the form. If editing module code, the Procedure box lists all of the general procedures in the module.


    • Object Box

    Displays the name of the selected object. Click the arrow to the right of the list box to display a list of all objects associated with the form.


    • Split Bar

    Dragging the Split bar down, splits the Code window into two horizontal panes, each of which scrolls separately. View different parts of code at the same time. Dragging the bar to the top or the bottom of the window or double-clicking the bar closes a pane.


    • Margin Indicator Bar

    A grey area on the left side of the Code window where margin indicators are displayed. Margin indicators provide visual cues during code editing.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •