Print this page Share

Mastering MIcrosoft VBA, 2nd Edition

ISBN: 978-0-7821-4436-9
736 pages
October 2005
Mastering MIcrosoft VBA, 2nd Edition (0782144365) cover image


  • VBA is used for writing macros, automating Office applications, and creating custom applications in Word, Excel, PowerPoint, Outlook, and Access
  • Easily accessible by novice programmers, VBA is also powerful enough for IT professionals who need to create specialized business applications, generating wide interest
  • Completely revised for the new versions of the language and the Office suite, this book is the most up-to-date VBA guide on the market
  • Includes what everyone, from power users to system administrators and professional developers, needs to know
  • Covers all Office products in depth
See More

Table of Contents


Part 1. Recording Macros and Getting Started with VBA.

Chapter 1. Recording and Running Macros in the Microsoft Office Applications.

Chapter 2. Getting Started with the Visual Basic Editor.

Chapter 3. Editing Recorded Macros.

Chapter 4. Creating Code from Scratch in the Visual Basic Editor.

Part 2. Learning How to Work with VBA.

Chapter 5. Understanding the Essentials of VBA Syntax.

Chapter 6. Working with Variables, Constants, and Enumerations.

Chapter 7. Using Array variables.

Chapter 8. Finding the Objects, Methods, and Properties You Need.

Part 3. Making Decisions and Using Loops and Functions.

Chapter 9. Using Functions.

Chapter 10. Creating Your Own Functions.

Chapter 11. making Decisions in Your Code.

Chapter 12. Using Loops to Repeat Actions.

Part 4. Using Message Boxes, Input Boxes, and Dialog Boxes.

Chapter 13. Getting User Input with Message Boxes and Input Boxes.

Chapter 14. Creating Simple Custom Dialog Boxes.

Chapter 15. Creating Complex Dialog Boxes.

Part 5. Creating Effective Code.

Chapter 16. Building Modular Code and Using Classes.

Chapter 17. Debugging Your Code and handling Errors.

Chapter 18. Building Well-Behaved Code.

Chapter 19. securing Your Code with VBA's security Features.

Part 6. Programming the Office Applications.

Chapter 20. Understanding the Word Object Model and Key Objects.

Chapter 21. Working with Widely Used Objects in Word.

Chapter 22. Understanding the Excel Object Model and Key Objects.

Chapter 23. Working with Widely Used Objects in Excel.

Chapter 24. Understanding the PowerPoint Object Model and Key Objects

Chapter 25. Working with Shapes and Running Slide Shows.

Chapter 26. Understanding the Outlook Object Model and Key Objects.

Chapter 27. Working with Events in Outlook.

Chapter 28. Understanding the Access Object Model and Key Objects.

Chapter 29. manipulating the Data in an Access Database via VBA.

Chapter 30. Accessing One Application from Another Application.



See More

Author Information

Well into his second decade of rebooting Windows PCs, Guy Hart-Davis has written dozens of computer books, including Word 97 Macro & VBA Handbook, Word 2000 Developer's Handbook, and three editions of Mastering Windows XP Home Edition.
See More


Download TitleSizeDownload
Code Listings.
Code listings and the corresponding VBA files.

To view this file, you can download a free version of Microsoft Word Viewer.

82.50 KB Click to Download
Code Modules and User Forms.
Code modules and user forms.

To open this zip file, you can use a free trial version of WinZip or WinRAR.

36.31 KB Click to Download
See More


Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.

ChapterPageDetailsDatePrint Run
6 107 Line of Code Omitted
Middle of page, in the block of code:
After the third line, "Dim lngController As Long," add a line that reads:
"Dim intReportNumber As Integer"
7 126 Text Correction
Under Searching through an Array, the second sentence:
"This section shows you two methods of sorting..." should read:
"This section shows you two methods of searching..."
7 132 Text Correction
Second-to-last bullet, last sentence:
"...and intBottom has a value of 0..." should read:
"...and intBottom has a value of 1, so intMiddle receives the value 500 (1001 divided by 2, rounded down)."
7 133 Text Correction
Step 2., last sentence:
"(Because the statement is broken onto two lines...)" should read:
"(Because the statement is broken onto three lines, the Visual Basic Editor displays three brown dots rather than one in the margin indicator bar.)
11 211 Text Correction
Third bullet, first sentence:
"If the length of strPassword is zero..." should read:
"If the length of strPassword is less than six characters..."

Fourth bullet, first sentence:
"If the length of strPassword isn't more than 15 characters..." should read:
"If the length of strPassword is at least six characters but not more than 15 characters..."
14 269 Figure 14.4 mis-labeled
Figure 14.4, labels at top:
Reverse the labels, so they read, from left to right:
Select Objects, Label, TextBox, ComboBox, and ListBox
See More

Learn more about

Back to Top