Set Display Options For The Code Window

You can modify the display settings for the text that displays on the Code window in the Visual Basic Editor. You can change the text color, font type, and font size for the text that displays in the Code window. You can not only specify the text color but also the background color. Just like any basic editor, the Code window has predefined formatting for the type of text that displays in the window. For example, there is a definition for comments and a different definition for normal text. You may not, however, always find these settings the most appealing. Fortunately, the Visual Basic Editor lets you customize the text settings for the Code window.

For font styles, the Visual Basic Editor enables you to select from the fonts installed on your machine. When dealing with source code (VBA), you may find code easier to read if you use a fixed-width font such as the Courier New font, the default font. This type of font is preferable because the characters in the code align vertically, making it easier to detect any spacing problems with the code.

The Margin Indicator Bar check box indicates whether a vertical indicator bar displays in the margin when you debug your code. Make sure that this option remains selected, because it helps to quickly spot the appropriate line of code when debugging. The Visual Basic Editor places symbols in the vertical indicator bar to indicate errors and break points. See Chapter 8 for more information on debugging.

As you make changes to the font settings for each of the formatting types, a sample of the font selections displays on the Editor Format tab.


File Edit View Insert Fermât Debug Run ii§

lil-l&l Microsoft Excel Objects É-S Modules

■ «££ Module 1 gff VBAProject (OfficeExpen B §§ VBAProject (PERSONAL.* Itl-Sa Microsoft Excel Objects É-S Modules

Module 1

J jJ

Module 1 Module »I

Alphabetic | categorized |

lools | Add-Ins Window Help

I Additional Controls,..

Expenses Properties. Digital Signature...

Sub SumCells I)

icded 5/19/2001 by Jinjer Sin

Keyboard Shot lulaRlCl = "=SUM(RC[-6] :RC[-1] ) "

""D Click Tools O Options r

■ The Options dialog box displays.

□ Click the 0 and click the desired font.

■ The Options dialog box displays.

Click the Editor Format tab.

Click the type of text for which you want to change the settings.

□ Click the 0 and click the desired font.

—Q Click the0and click the font size.


0 0

Post a comment