Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword or section
Like this

Table Of Contents

About This Book
Conventions Used in This Book
What You Should Read
What You Don’t Have to Read
Foolish Assumptions
How This Book Is Organized
Part I: An Overview of VBA
Part II: Learning the Ropes
Part III: Expanding Your VBA Horizons
Part V: The Part of Tens
The accompanying Web site
Icons Used in This Book
Where to Go from Here
Chapter 1
Batteries Included — VBA Comes with Office
VBA: It’s Not Just for Programmers
Automating documents
Customizing an application’s interface
Performing calculations
Getting stuff from a database
Adding new application features
Making special tools
Having things your way
Other Products Use VBA, Too
A Room with a View
Looking at the Integrated Development Environment (IDE)
Looking at the VBA Toolbox
Looking at objects
Starting the Visual Basic Editor
Word 2007, Excel 2007, and PowerPoint 2007
Access 2007
Security under Vista
Using Project Explorer
Using the Properties window
Using the Code window
Using the Immediate window
Using Object Browser
Deciding What to Do
Steps to Create a VBA Program
Step 1: Design the program
Step 2: Implement the design
Step 3: Test, test, test
Step 4: Swat the bugs
Four Ways to Run Your Program
Using the Macro dialog box
Using the quick-launch methods
Accessing the program from other VBA code
Executing the VBA program automatically
Using Help to Your Advantage — Stealing Microsoft’s Code
Parts of a Program
Defining the parts of a program
Understanding the VBA programming blocks
Using the Macro Recorder
Using Subs
Using Functions
Modifying the project settings
Defining compiler options
Taking the Lego Approach
Creating an application plan
Defining the project
Adding a module
Designing procedures
Writing statements
Writing Your First Sub
Writing Your First Function
Getting the Scoop on Scope
Understanding the purpose of scope
Defining the effects of scope
Creating Readable Code
Telling Others about Your Code
Writing basic comments
Knowing when to use comments
Understanding how to create a good comment
Understanding Variables and Constants
Making the declaration
Knowing which storage type to use
Defining scope
Defining the Data Types
Using strings for text
Using numbers for calculations
Using Boolean values to make decisions
Using scientific values for math calculations
Using currency values for money calculations
Using date and time values
Working with variant data
Presenting data in a pleasing format
Working with Operators
Applying What You Know to Design an Excel Report
Exercising Control with Structures
Making a Decision with the If...ThenStatement
Using the If...Then statement
Using the If...Then...Else statement
Using the If...Then...ElseIf statement
Using the IIf function
Making a Choice by Using the SelectCase Statement
Using the Select Case statement
Using the Case Else clause
Performing a Task More than OncebyUsing Loops
Using the Do While...Loop statement
Using the Do...Loop While statement
Using the Do Until...Loop statement
Using the Do...Loop Until statement
Using the For...Next statement
Using the For Each...Next statement
Redirecting the Flow by Using GoTo
Using the GoTo statement correctly
Avoiding misuse of the GoTo statement
Knowing the Enemy
Understanding syntax errors
Understanding compile errors
Understanding run-time errors
Understanding semantic errors
Prevention Is Better than a Cure
Avoiding run-time errors
Recovering from an error
Understanding error handlers
Writing your own error-handling code
Reporting errors
Saving and Restoring Code
Exporting a module from a program
Importing a module in a program
Time for a Bug Hunt
Executing a break
Taking individual steps
Viewing the data tips
Using the Immediate window toyouradvantage
Using the Locals Window
Using the Watches Window
Using the Label control to display text
Getting user input with text boxes
Executing tasks with command buttons
Saying yes or no with check boxes and toggle buttons
Making choices with option buttons and frames
Choosing options with list boxes and combo boxes
Adding controls to the Toolbox
Using the Forms You Create
Modifying the form and control properties
Making your form pretty
Creating a connection between forms and modules
Validating user input
Handling form events
Understanding Classes
Understanding object-oriented programming concepts
Understanding properties, methods, and events
Defining classes
Considering class types
Using classes to improve your applications
Designing a Basic Class
Defining properties
Defining methods
Defining events
Using enumerated constants
Defining initialization
Setting the Instancing property
Creating useful classes
Using Your New Object in an Application
Adding Error Handling to Classes
Using the With Statement
Adding a Digital Signature to Your Creation
Obtaining a digital signature
Creating a test digital signature
Applying the digital signature to a project
Using Arrays for Structured Storage
Understanding array usage
Understanding the array types
Copying data from one array to another
Using Collections to Create Data Sets
Understanding collection usage
Adding keyed data to the collection
Accessing predefined collection items
Defining Your Own Data Types
Understanding user-defined data types
Knowing when to create your own data type
Accessing and manipulating data
Using Disk Storage
Application configuration information
Data translation
Data storage
Working with Settings
Writing an INI file
Reading an INI file
Comparing WordML with Saved XML
Manipulating XML Data
Writing the data to disk
Defining a schema
Defining XSD to worksheet linkage
Exporting the data to disk
Importing the data from disk
Creating a Simple Word XML Document
Changing the Face of XML with XSLT
Saving your Word document by using XSLT
Automating the Word XML process
Working with the User Environment
Beneficial changes that you can make
Problems that you should consider
Manipulating Toolbars and Menus
Displaying or hiding toolbars and menus
Modifying the toolbar or menu content
Adding and removing toolbars and menus
Working with the New Ribbon Interface
Understanding the application file content
Obtaining and using the Office 2007 Custom UI Editor
Adding a tab, group, and button
Performing tasks when the Ribbon loads
Modifying existing tabs
Using the Windows collection
Accessing the Word Document
Using the Registry with VBA
Overcoming UAC problems in Vista
Accessing any Registry locations in Office
Selecting Objects in a Word Document
Understanding object connectivity
Manipulating Text
Working with Envelopes and Labels
Designing the envelope and label form
Printing envelopes
Printing labels
Understanding the Excel-Related Objects
Using the Workbooks collection
Using the Sheets collection
Using the Charts collection
Selecting Objects within Excel
Developing Custom Functions in Excel
Performing data conversion
Defining math calculations
Adding comments to your functions
Understanding the Access-Related Objects
Understanding Access and sub-procedure use
Using the Application object effectively
Defining your work area with the Workspaces collection
Working with the DBEngine object
Using the CurrentDB and related objects
Understanding the Database objects
Understanding SQL: A Quick Overview
Creating a SQL query the easy way
Using the SQL query
Adding Form-Related Applications
Creating Automatic Applications
Starting and Stopping External Applications
Deciding how to perform the task
Creating the Win32 API calls
Encapsulating the process
Calling the AccessExternalProgram function
Processing Outlook E-Mail Messages with Word
Sending E-Mail Messages with Outlook
Sending Notes from Word to Excel
The Part of Tens
Using Magazines and Periodicals
Traditional paper magazines and periodicals
Free electronic newsletters
Using RSS to Obtain the Latest Information
Finding Interesting Newsgroups and List Servers
Microsoft-specific newsgroups
Third-party newsgroups
List servers that you access through e-mailand Web sites
Locating Just the Right Code
Getting Tools to Make ProgrammingEasier
Learning When That Old Code Won’tUpdate
Using the Code in This Book for Updates
0 of .
Results for:
No results containing your search query
P. 1
VBA training

VBA training

Ratings: (0)|Views: 237|Likes:
Published by Suraj Pillai
VBA Editing etc. described in a concisive way
VBA Editing etc. described in a concisive way

More info:

Published by: Suraj Pillai on Feb 05, 2013
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





You're Reading a Free Preview
Pages 9 to 106 are not shown in this preview.
You're Reading a Free Preview
Pages 115 to 169 are not shown in this preview.
You're Reading a Free Preview
Pages 178 to 294 are not shown in this preview.
You're Reading a Free Preview
Pages 303 to 404 are not shown in this preview.
You're Reading a Free Preview
Pages 413 to 428 are not shown in this preview.

Activity (5)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
ash1968 liked this
David Gonzalez liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->