did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780789730763

Absolute Beginner's Guide to Vba

by
  • ISBN13:

    9780789730763

  • ISBN10:

    0789730766

  • Edition: 1st
  • Format: Paperback
  • Copyright: 2004-03-09
  • Publisher: Que Publishing

Note: Supplemental materials are not guaranteed with Rental or Used book purchases.

Purchase Benefits

  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
  • Complimentary 7-Day eTextbook Access - Read more
    When you rent or buy this book, you will receive complimentary 7-day online access to the eTextbook version from your PC, Mac, tablet, or smartphone. Feature not included on Marketplace Items.
List Price: $24.95 Save up to $6.24
  • Buy Used
    $18.71

    USUALLY SHIPS IN 2-4 BUSINESS DAYS

    7-Day eTextbook Access 7-Day eTextbook Access

Supplemental Materials

What is included with this book?

Summary

Absolute Beginner's Guide to VBA shows you how to take full advantage of the Microsoft Office Suite by automating routine Office tasks. No matter which Office application you're using, there are some tasks you perform dozens of times, such as typing and formatting a section of text, running a series of menu commands, or editing a document in a particular way. This book shows you how to accomplish the same results with the click of a button. Even if you've never programmed before, the simple step-by-step approach of Absolute Beginner's Guide to VBA will have you up to speed with VBA in no time! Book jacket.

Author Biography

Paul McFedries is well-known as a teacher of Office, Windows, and VBA. He is the president of Logophilia Limited and has been programming computers for more than 25 years

Table of Contents

Introductionp. 1
Getting Started with VBAp. 5
Recording Your First Macrop. 7
What Is a Macro?p. 8
What Does VBA Have to Do with Macros?p. 8
Understanding VBA Proceduresp. 9
Recording a VBA Macrop. 10
Viewing the Resulting Modulep. 12
Editing a Recorded Macrop. 13
Writing Your Own Macrosp. 15
Displaying the Visual Basic Editorp. 16
Touring the Visual Basic Editorp. 17
Opening an Existing Modulep. 17
Creating a New Modulep. 18
Writing Your Own Command Macrop. 18
Running a VBA Macrop. 20
Creating User-Defined Functions with VBAp. 21
Understanding User-Defined Functionsp. 21
Writing User-Defined Functionsp. 22
Employing User-Defined Functionsp. 23
Working with Proceduresp. 23
The Structure of a Procedurep. 23
Calling a Procedurep. 24
Taking Advantage of IntelliSensep. 26
Working with Comment Blocksp. 30
Working with Modulesp. 31
Renaming a Modulep. 31
Exporting a Modulep. 31
Importing a Modulep. 32
Removing a Modulep. 32
Shutting Down the Visual Basic Editorp. 32
Understanding Program Variablesp. 35
Declaring Variablesp. 36
Avoiding Variable Errorsp. 37
Variable Data Typesp. 38
Using Array Variablesp. 40
Working with Constantsp. 41
Using Built-In Constantsp. 41
Creating User-Defined Constantsp. 41
Building VBA Expressionsp. 43
Working with VBA Operatorsp. 45
Arithmetic Operatorsp. 46
The Concatenation Operatorp. 46
Comparison Operatorsp. 47
Logical Operatorsp. 47
Understanding Operator Precedencep. 48
The Order of Precedencep. 48
Controlling the Order of Precedencep. 49
Working with Numeric Expressionsp. 51
VBA's Math Functionsp. 51
VBA's Financial Functionsp. 53
Working with String Expressionsp. 54
Working with Logical Expressionsp. 57
The And Operatorp. 58
The Or Operatorp. 58
The Xor Operatorp. 58
The Not Operatorp. 58
Working with Date Expressionsp. 58
Working with Objectsp. 63
The Object Hierarchyp. 65
Working with Object Propertiesp. 65
Setting the Value of a Propertyp. 67
Returning the Value of a Propertyp. 67
Working with Object Methodsp. 68
Handling Object Eventsp. 70
Working with Object Collectionsp. 71
Assigning an Object to a Variablep. 72
The Is Operatorp. 72
Working with Multiple Properties or Methodsp. 73
Example: The Application Objectp. 75
Properties of the Application Objectp. 75
Methods of the Application Objectp. 77
Example: The Window Objectp. 78
Specifying a Window Objectp. 79
Opening a New Windowp. 79
Window Object Propertiesp. 79
Window Object Methodsp. 80
Controlling Your VBA Codep. 83
Code That Makes Decisionsp. 84
Using If...Then to Make True/False Decisionsp. 84
Using If...Then...Else to Handle a False Resultp. 86
Making Multiple Decisionsp. 87
Using the And and Or Operatorsp. 87
Using Multiple If...Then...Else Statementsp. 88
Using the Select Case Statementp. 90
Functions That Make Decisionsp. 95
The IIf Functionp. 95
The Choose Functionp. 96
The Switch Functionp. 97
Code That Loopsp. 99
Using Do...Loop Structuresp. 99
Using For...Next Loopsp. 101
Using For Each...Next Loopsp. 103
Using Exit For or Exit Do to Exit a Loopp. 105
Putting VBA to Workp. 109
Programming Wordp. 111
Working with Documentsp. 112
Specifying a Document Objectp. 112
Opening a Documentp. 112
The RecentFiles Objectp. 113
Creating a New Documentp. 114
Saving a Documentp. 115
Closing a Documentp. 117
Example: Making Document Backupsp. 118
More Useful Document Object Methodsp. 121
Working with Textp. 123
The Range Objectp. 123
The Range Methodp. 124
The Range Propertyp. 124
Reading and Changing Range Textp. 124
Formatting Textp. 125
Some Useful Range Object Methodsp. 126
The Selection Objectp. 127
Checking the Selection Typep. 127
Selection Object Methodsp. 127
The Characters Objectp. 131
The Words Objectp. 132
The Sentences Objectp. 134
The Paragraph Objectp. 134
Some Useful Paragraph Object Propertiesp. 134
Some Useful Paragraph Object Methodsp. 135
Programming Excelp. 137
Excel's Application Objectp. 138
Accessing Worksheet Functionsp. 138
Methods of Excel's Application Objectp. 138
Some Event-Like Methodsp. 140
Manipulating Workbook Objectsp. 145
Specifying a Workbook Objectp. 145
Opening a Workbookp. 146
Creating a New Workbookp. 146
Workbook Object Propertiesp. 147
Workbook Object Methodsp. 147
Dealing with Worksheet Objectsp. 149
Specifying a Worksheet Objectp. 149
Creating a New Worksheetp. 149
Properties of the Worksheet Objectp. 150
Methods of the Worksheet Objectp. 150
Working with Range Objectsp. 151
Returning a Range Objectp. 152
Using the Offset Methodp. 155
Selecting a Cell or Rangep. 157
Defining a Range Namep. 157
More Range Object Propertiesp. 158
More Range Object Methodsp. 158
Programming PowerPointp. 163
PowerPoint's Application Objectp. 164
PowerPoint's Presentation Objectp. 164
Specifying a Presentation Objectp. 164
Opening a Presentationp. 165
Creating a New Presentationp. 165
Presentation Object Propertiesp. 166
Presentation Object Methodsp. 166
The Juggling Applicationp. 167
Working with PowerPoint Slide Objectsp. 170
Specifying a Slidep. 170
Creating a New Slidep. 171
Inserting Slides from a Filep. 171
Slide Object Propertiesp. 172
The Juggling Application: Creating the Slidesp. 173
Slide Object Methodsp. 174
Dealing with Shape Objectsp. 174
Specifying a Shapep. 175
Adding Shapes to a Slidep. 175
Some Shape Object Propertiesp. 179
The Juggling Application: Creating the Title Pagep. 181
Some Shape Object Methodsp. 183
The Juggling Application: Creating the Instructionsp. 184
Operating a Slide Showp. 187
Slide Show Transitionsp. 188
Slide Show Settingsp. 188
Running the Slide Showp. 189
Programming Access Databasesp. 191
Getting Ready: Two Steps Before You Beginp. 192
Create a Referencep. 192
Create a Data Sourcep. 193
Working with Database Records: Opening a Recordsetp. 194
Opening a Recordset Using a Tablep. 196
Opening a Recordset Using a SELECT Stringp. 198
Working with a Recordsetp. 200
Getting at the Recordset Datap. 200
Navigating Recordsp. 202
Finding a Recordp. 204
Editing a Recordp. 206
Adding a New Recordp. 208
Deleting a Recordp. 210
Retrieving Data into Excelp. 211
Retrieving an Individual Field Valuep. 212
Retrieving One or More Entire Rowsp. 212
Retrieving an Entire Recordsetp. 214
Programming Outlook Emailp. 219
Working with Outlook Foldersp. 220
Referencing Default Foldersp. 220
Using the Folders Propertyp. 221
Prompting the User for a Folderp. 222
Some MAPIFolder Methodsp. 224
Working with Email Messagesp. 224
MailItem Object Propertiesp. 224
MailItem Object Methodsp. 226
Sending a Messagep. 228
Creating a New Messagep. 228
Creating a Reply or Forwardp. 228
Specifying the Message Recipientsp. 229
Sending the Messagep. 230
Working with Attachmentsp. 231
Programming Outlook from Other Applicationsp. 233
Setting Up a Reference to Outlookp. 233
Getting the NameSpace Objectp. 234
Logging On to an Outlook Sessionp. 234
Logging Off an Outlook Sessionp. 235
Getting the Most Out of VBAp. 239
Interacting with the Userp. 241
Programming Soundsp. 242
Beeping the Speakerp. 242
Programming PowerPoint Sound Effectsp. 243
Displaying Information to the Userp. 243
Displaying a Message in the Status Barp. 244
Displaying a Message Using MsgBoxp. 250
Getting Input from the Userp. 254
Prompting the User for Inputp. 255
Accessing an Application's Built-In Dialog Boxesp. 257
Creating Custom VBA Dialog Boxesp. 263
Adding a Form to Your Projectp. 264
Changing the Form's Design-Time Propertiesp. 265
The Appearance Categoryp. 266
The Behavior Categoryp. 266
The Font Categoryp. 266
The Misc Categoryp. 267
The Picture Categoryp. 267
The Position Categoryp. 267
The Scrolling Categoryp. 267
Working with Controlsp. 268
Inserting Controls on a Formp. 268
Selecting Controlsp. 269
Sizing Controlsp. 270
Moving Controlsp. 270
Copying Controlsp. 271
Deleting Controlsp. 271
Grouping Controlsp. 271
Setting Control Propertiesp. 272
Common Control Propertiesp. 272
Setting the Tab Orderp. 273
Handling Form Eventsp. 274
Types of Form Controlsp. 275
Command Buttonsp. 275
Labelsp. 275
Text Boxesp. 276
Framesp. 277
Option Buttonsp. 277
Check Boxesp. 278
Toggle Buttonsp. 278
List Boxesp. 278
Scrollbarsp. 280
Spin Buttonsp. 280
Tab Strips and MultiPage Controlsp. 281
Using a Form in a Procedurep. 285
Displaying the Formp. 285
Unloading the Formp. 286
Processing the Form Resultsp. 287
Creating Custom Menus and Toolbarsp. 291
Assigning Macros to Menu Commandsp. 292
First, a Game Planp. 292
Creating a New Menup. 293
Creating a New Submenup. 294
Adding Menu Commands and Assigning Macrosp. 295
Deleting Menus and Menu Commandsp. 296
Creating Custom Toolbars for Your Macrosp. 296
Creating a New Toolbarp. 296
Adding a Toolbar Button and Assigning a Macrop. 297
Menus, Toolbars, and VBAp. 297
Understanding Command Barsp. 298
Specifying a Command Barp. 299
Creating a New Command Barp. 301
Command Bar Propertiesp. 302
Deleting a Custom Command Barp. 305
Resetting a Built-In Command Barp. 305
Working with Command Bar Controlsp. 306
Specifying a Controlp. 306
Adding a Control to a Command Barp. 308
The Command Bar Info Utilityp. 309
Control Propertiesp. 309
Control Methodsp. 313
Debugging VBA Proceduresp. 315
Trapping Program Errorsp. 316
A Basic Error-Trapping Strategyp. 316
Working with the Err Objectp. 324
Err Object Propertiesp. 325
A Basic Strategy for Debuggingp. 327
Syntax Errorsp. 327
Compile Errorsp. 328
Runtime Errorsp. 328
Logic Errorsp. 328
Pausing a Procedurep. 329
Entering Break Modep. 329
Exiting Break Modep. 331
Stepping Through a Procedurep. 332
Stepping into a Procedurep. 333
Stepping Over a Procedurep. 333
Stepping Out of a Procedurep. 333
Stepping to the Cursorp. 334
Monitoring Procedure Valuesp. 334
Using the Locals Windowp. 334
Adding a Watch Expressionp. 334
Editing a Watch Expressionp. 336
Deleting a Watch Expressionp. 337
Displaying Data Values Quicklyp. 337
Using the Immediate Windowp. 338
Printing Data in the Immediate Windowp. 338
Executing Statements in the Immediate Windowp. 340
Debugging Tipsp. 341
Indent Your Code for Readabilityp. 341
Turn on Syntax Checkingp. 341
Require Variable Declarationsp. 341
Break Down Complex Proceduresp. 342
Enter VBA Keywords in Lowercasep. 342
Comment Out Problem Statementsp. 342
Break Up Long Statementsp. 342
Use Excel's Range Names Whenever Possiblep. 342
Take Advantage of User-Defined Constantsp. 342
Appendixesp. 345
VBA Statementsp. 347
VBA Functionsp. 353
Table of Contents provided by Ingram. All Rights Reserved.

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program