Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 32. Getting Started with VBA > Reading and Editing Your Recorded VBA Co...

Reading and Editing Your Recorded VBA Code

The best way to get started with the Visual Basic Editor is to record a macro, and then to study the code you've recorded. For example, you can record a macro that adds a place for your signature to the end of any document. Follow these steps to record the macro:

  1. Open a document to use as a test document while you are recording the macro.

  2. Double-click the REC button on the status bar. The Record Macro dialog box appears.

  3. Type Signature as the macro name, and click OK.

  4. Press Ctrl+End to move to the end of the document.

  5. Press Enter twice to add a paragraph and a blank line.

  6. Type Sincerely, then press Enter four times.

  7. Type your name, and press Enter.

  8. Press Ctrl+I to turn on italic.

  9. Type your title, then press Ctrl+I to turn off italic.

  10. Press Enter to add another paragraph.

  11. Double-click the REC button on the status bar to turn the macro recorder off.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial