Share this Page URL

Chapter 43. Building Custom Applications... > Displaying Messages - Pg. 1085

Building Custom Applications with VBA 1085 Both the Cells() property and the Range() property work equally well: With the former, you must specify the numeric location of the cell (with the column first, then the row, so B3, for example, becomes Cells(2,3)); with the latter, you have to refer to the range with a standard address, such as A1:C3. A Range designation might include $ (dollar signs)--you can use the dollar signs as you would to indicate an absolute cell or range reference--but VBA/Excel ignores them. Adding Text to a PowerPoint Presentation with VBA PowerPoint uses the InsertBefore and InsertAfter methods to place text on a slide. Un- fortunately, PowerPoint's objects work completely differently from Word's or Excel's, so you'll have an interesting time trying to get off the ground. For example, to insert text before the currently selected text on a slide, you have to use this mon- strosity: ActiveWindow.Selection.TextRange.InsertBefore "Some text" Word has a Selection object--but it doesn't require the ActiveWindow. or .TextRange you see here. Unfortunately, VBA/PowerPoint won't work without all the extra baggage. Strike another blow against consistency across the Office applications. Displaying Messages All the versions of VBA in the Office suite include three quick and easy ways to present messages to the user: