Course (4-5) Excel VBA
- 1. What Is VBA?
- 1.1. Okay, So What Is VBA?
- 1.2. What Can You Do with VBA?
- 1.2.1. Inserting a bunch of text
- 1.2.2. Automating a task you perform frequently
- 1.2.3. Automating repetitive operations
- 1.2.4. Creating a custom command
- 1.2.5. Creating a custom button
- 1.2.6. Developing new worksheet functions
- 1.2.7. Creating complete, macro-driven applications
- 1.2.8. Creating custom add-ins for Excel
- 1.3. Advantages and Disadvantages of VBA
- 1.3.1. VBA advantages
- 1.3.2. VBA disadvantages
- 1.4. VBA in a Nutshell
- 1.5. An Excursion into Versions
- 2. Jumping Right In
- 2.1. First Things First
- 2.1.1. Excel 2010 Users
- 2.1.2. Excel 2007 Users
- 2.2. What You’ll Be Doing
- 2.3. Taking the First Steps
- 2.4. Recording the Macro
- 2.5. Testing the Macro
- 2.6. Examining the Macro
- 2.7. Modifying the Macro
- 2.8. Saving Workbooks That Contain Macros
- 2.9. Understanding Macro Security
- 2.10. More about the NameAndTime Macro
- 2.1. First Things First
- 3. Working In the Visual Basic Editor
- 3.1. What Is the Visual Basic Editor?
- 3.1.1. Activating the VBE
- 3.1.2. Understanding VBE components
- 3.2. Working with the Project Window
- 3.2.1. Adding a new VBA module
- 3.2.2. Removing a VBA module
- 3.2.3. Exporting and importing objects
- 3.3. Working with a Code Window
- 3.3.1. Minimizing and maximizing windows
- 3.3.2. Creating a module
- 3.3.3. Getting VBA code into a module
- 3.3.4. Entering code directly
- 3.3.5. Using the macro recorder
- 3.3.6. Copying VBA code
- 3.4. Customizing the VBA Environment
- 3.4.1. Using the Editor tab
- 3.4.2. Using the Editor Format tab
- 3.4.3. Using the General tab
- 3.4.4. Using the Docking tab
- 3.1. What Is the Visual Basic Editor?
- 4. Introducing the Excel Object Model
- 4.1. Excel Is an Object?
- 4.2. Climbing the Object Hierarchy
- 4.3. Wrapping Your Mind around Collections
- 4.4. Referring to Objects
- 4.4.1. Navigating through the hierarchy
- 4.4.2. Simplifying object references
- 4.5. Diving into Object Properties and Methods
- 4.5.1. Object properties
- 4.5.2. Object methods
- 4.5.3. Object events
- 4.6. Finding Out More
- 4.6.1. Using VBA’s Help system
- 4.6.2. Using the Object Browser
- 4.6.3. Automatically listing properties and methods
- 5. VBA Sub and Function Procedures
- 5.1. Subs versus Functions
- 5.1.1. Looking at Sub procedures
- 5.1.2. Looking at Function procedures
- 5.1.3. Naming Subs and Functions
- 5.2. Executing Sub procedures
- 5.2.1. Executing the Sub procedure directly
- 5.2.2. Executing the procedure from the Macro dialog box
- 5.2.3. Executing a macro by using a shortcut key
- 5.2.4. Executing the procedure from a button or shape
- 5.2.5. Executing the procedure from another procedure
- 5.3. Executing Function procedures
- 5.3.1. Calling the function from a Sub procedure
- 5.3.2. Calling a function from a worksheet formula
- 5.1. Subs versus Functions
- 6. Using the Excel Macro Recorder
- 6.1. Is It Live or Is It VBA?
- 6.2. Recording Basics
- 6.3. Preparing to Record
- 6.4. Relative or Absolute?
- 6.4.1. Recording in absolute mode
- 6.4.2. Recording in relative mode
- 6.5. What Gets Recorded?
- 6.6. Recording Options
- 6.6.1. Macro name
- 6.6.2. Shortcut key
- 6.6.3. Store Macro In
- 6.6.4. Description
- 6.7. Is This Thing Effi cient?
- 7. Essential VBA Language Elements
- 7.1. Using Comments in Your VBA Code
- 7.2. Using Variables, Constants, and Data Types
- 7.2.1. Understanding variables
- 7.2.2. What are VBA’s data types?
- 7.2.3. Declaring and scoping variables
- 7.2.4. Working with constants
- 7.2.5. Pre-made constants
- 7.2.6. Working with strings
- 7.2.7. Working with dates
- 7.3. Using Assignment Statements
- 7.3.1. Assignment statement examples
- 7.3.2. About that equal sign
- 7.3.3. Smooth operators
- 7.4. Working with Arrays
- 7.4.1. Declaring arrays
- 7.4.2. Multidimensional arrays
- 7.4.3. Dynamic arrays
- 7.5. Using Labels
- 8. Working with Range Objects
- 8.1. A Quick Review
- 8.2. Other Ways to Refer to a Range
- 8.2.1. The Cells property
- 8.2.2. The Offset property
- 8.2.3. Referring to entire columns and rows
- 8.3. Some Useful Range Object Properties
- 8.3.1. The Value property
- 8.3.2. The Text property
- 8.3.3. The Count property
- 8.3.4. The Column and Row properties
- 8.3.5. The Address property
- 8.3.6. The HasFormula property
- 8.3.7. The Font property
- 8.3.8. The Interior property
- 8.3.9. The Formula property
- 8.3.10. The NumberFormat property
- 8.3.11. Some Useful Range Object Methods
- 8.4. The Select method
- 8.4.1. The Copy and Paste methods
- 8.4.2. The Clear method
- 8.4.3. The Delete method
- 9. Using VBA and Worksheet Functions
- 9.1. What Is a Function?
- 9.2. Using Built-In VBA Functions
- 9.2.1. VBA function examples
- 9.2.2. VBA functions that do more than return a value
- 9.2.3. Discovering VBA functions
- 9.3. Using Worksheet Functions in VBA
- 9.3.1. Worksheet function examples
- 9.3.2. Entering worksheet functions
- 9.4. More about Using Worksheet Functions
- 9.5. Using Custom Functions
- 10. Controlling Program Flow and Making Decisions
- 10.1. Going with the Flow, Dude
- 10.2. The GoTo Statement
- 10.2.1. Decisions, decisions
- 10.2.2. The If-Then structure
- 10.2.3. The Select Case structure
- 10.3. Knocking Your Code for a Loop
- 10.3.1. For-Next loops
- 10.3.2. Do-While loop
- 10.3.3. Do-Until loop
- 10.4. Looping through a Collection
- 11. Automatic Procedures and Events
- 11.1. Preparing for the Big Event
- 11.1.1. Are events useful?
- 11.1.2. Programming event-handler procedures
- 11.2. Where Does the VBA Code Go?
- 11.3. Writing an Event-Handler Procedure
- 11.4. Introductory Examples
- 11.4.1. The Open event for a workbook
- 11.4.2. The BeforeClose event for a workbook
- 11.4.3. The BeforeSave event for a workbook
- 11.5. Examples of Activation Events
- 11.5.1. Activate and deactivate events in a sheet
- 11.5.2. Activate and deactivate events in a workbook
- 11.5.3. Workbook activation events
- 11.6. Other Worksheet-Related Events
- 11.6.1. The BeforeDoubleClick event
- 11.6.2. The BeforeRightClick event
- 11.6.3. The Change event
- 11.7. Events Not Associated with Objects
- 11.7.1. The OnTime event
- 11.7.2. Keypress events
- 11.1. Preparing for the Big Event
- 12. Error-Handling Techniques
- 12.1. Types of Errors
- 12.2. An Erroneous Example
- 12.2.1. The macro’s not quite perfect
- 12.2.2. The macro is still not perfect
- 12.2.3. Is the macro perfect yet?
- 12.2.4. Giving up on perfection
- 12.3. Handling Errors Another Way
- 12.3.1. Revisiting the EnterSquareRoot procedure
- 12.3.2. About the On Error statement
- 12.4. Handling Errors: The Details
- 12.4.1. Resuming after an error
- 12.4.2. Error handling in a nutshell
- 12.4.3. Knowing when to ignore errors
- 12.4.4. Identifying specifi c errors
- 12.5. An Intentional Error
- 13. Bug Extermination Techniques
- 13.1. Species of Bugs
- 13.2. Identifying Bugs
- 13.3. Debugging Techniques
- 13.3.1. Examining your code
- 13.3.2. Using the MsgBox function
- 13.3.3. Inserting Debug.Print statements
- 13.3.4. Using the VBA debugger
- 13.4. About the Debugger
- 13.4.1. Setting breakpoints in your code
- 13.4.2. Using the Watch window
- 13.4.3. Using the Locals Window
- 13.5. Bug Reduction Tips
- 14. VBA Programming Examples
- 14.1. Working with Ranges
- 14.1.1. Copying a range
- 14.1.2. Copying a variable-sized range
- 14.1.3. Selecting to the end of a row or column
- 14.1.4. Selecting a row or column
- 14.1.5. Moving a range
- 14.1.6. Looping through a range effi ciently
- 14.1.7. Looping through a range effi ciently (Part II)
- 14.1.8. Prompting for a cell value
- 14.1.9. Determining the selection type
- 14.1.10. Identifying a multiple selection
- 14.2. Changing Excel Settings
- 14.2.1. Changing Boolean settings
- 14.2.2. Changing non-Boolean settings
- 14.3. Working with Charts
- 14.3.1. Modifying the chart type
- 14.3.2. Looping through the ChartObjects collection
- 14.3.3. Modifying chart properties
- 14.3.4. Applying chart formatting
- 14.4. VBA Speed Tips
- 14.4.1. Turning off screen updating
- 14.4.2. Turning off automatic calculation
- 14.4.3. Eliminating those pesky alert messages
- 14.4.4. Simplifying object references
- 14.4.5. Declaring variable types
- 14.4.6. Using the With-End With structure
- 14.1. Working with Ranges
- 15. Simple Dialog Boxes
- 15.1. UserForm Alternatives
- 15.2. The MsgBox Function
- 15.2.1. Getting a response from a message box
- 15.2.2. Customizing message boxes
- 15.3. The InputBox Function
- 15.3.1. InputBox syntax
- 15.3.2. An InputBox example
- 15.4. The GetOpenFilename Method
- 15.4.1. The syntax for the GetOpenFilename method
- 15.4.2. A GetOpenFilename example
- 15.4.3. Selecting multiple fi les
- 15.5. The GetSaveAsFilename Method
- 15.6. Getting a Folder Name
- 15.7. Displaying Excel’s Built-in Dialog Boxes
- 16. UserForm Basics
- 16.1. Knowing When to Use a UserForm
- 16.2. Creating UserForms: An Overview
- 16.3. Working with UserForms
- 16.3.1. Inserting a new UserForm
- 16.3.2. Adding controls to a UserForm
- 16.3.3. Changing properties for a UserForm control
- 16.3.4. Viewing the UserForm Code window
- 16.3.5. Displaying a UserForm
- 16.3.6. Using information from a UserForm
- 16.4. A UserForm Example
- 16.4.1. Creating the UserForm
- 16.4.2. Adding the CommandButtons
- 16.4.3. Adding the OptionButtons
- 16.4.4. Adding event-handler procedures
- 16.4.5. Creating a macro to display the dialog box
- 16.4.6. Making the macro available
- 16.4.7. Testing the macro
- 17. Using UserForm Controls
- 17.1. Getting Started with Dialog Box Controls
- 17.1.1. Adding controls
- 17.1.2. Introducing control properties
- 17.2. Dialog Box Controls: The Details
- 17.2.1. CheckBox control
- 17.2.2. ComboBox control
- 17.2.3. CommandButton control
- 17.2.4. Frame control
- 17.2.5. Image control
- 17.2.6. Label control
- 17.2.7. ListBox control
- 17.2.8. MultiPage control
- 17.2.9. OptionButton control
- 17.2.10. RefEdit control
- 17.2.11. ScrollBar control
- 17.2.12. SpinButton control
- 17.2.13. TabStrip control
- 17.2.14. TextBox control
- 17.2.15. ToggleButton control
- 17.3. Working with Dialog Box Controls
- 17.3.1. Moving and resizing controls
- 17.3.2. Aligning and spacing controls
- 17.3.3. Accommodating keyboard users
- 17.3.4.Testing a UserForm
- 17.4. Dialog Box Aesthetics
- 17.1. Getting Started with Dialog Box Controls
- 18. UserForm Techniques and Tricks
- 18.1. Using Dialog Boxes
- 18.2. A UserForm Example
- 18.2.1. Creating the dialog box
- 18.2.2. Writing code to display the dialog box
- 18.2.3. Making the macro available
- 18.2.4. Trying out your dialog box
- 18.2.5. Adding event-handler procedures
- 18.2.6. Validating the data
- 18.2.7. Now the dialog box works
- 18.3. More UserForm Examples
- 18.3. A ListBox example
- 18.3.1. Selecting a range
- 18.3.2. Using multiple sets of OptionButtons
- 18.3.3. Using a SpinButton and a TextBox
- 18.3.4. Using a UserForm as a progress indicator
- 18.3.5. Creating a tabbed dialog box
- 18.3.6. Displaying a chart in a UserForm
- 18.4. A Dialog Box Checklist
- 19. Accessing Your Macros through the User Interface
- 19.1. What Happened to CommandBars?
- 19.2. Ribbon Customization
- 19.2.1. Customizing the Ribbon manually
- 19.2.2. Customizing the Ribbon with XML
- 19.3. Customizing Shortcut Menus
- 19.3.1. Commanding the CommandBars collection
- 19.3.2. Listing all shortcut menus
- 19.3.3. Referring to CommandBars
- 19.3.4. Referring to controls in a CommandBar
- 19.3.5. Properties of CommandBar controls
- 19.4. VBA Shortcut Menu Examples
- 19.4.1. Adding a new item to the Cell shortcut menu
- 19.4.2. Disabling a shortcut menu
- 19.5. Creating a Custom Toolbar
- 20. Creating Worksheet Functions and Living to Tell about It
- 20.1. Why Create Custom Functions?
- 20.2. Understanding VBA Function Basics
- 20.3. Writing Functions
- 20.4. Working with Function Arguments
- 20.5. Function Examples
- 20.5.1. A function with no argument
- 20.5.2. A function with one argument
- 20.5.3. A function with two arguments
- 20.5.4. A function with a range argument
- 20.5.5. A function with an optional argument
- 20.5.6. A function with an indefi nite number of arguments
- 20.6. Functions That Return an Array
- 20.6.1. Returning an array of month names
- 20.6.2. Returning a sorted list
- 20.7. Using the Insert Function Dialog Box
- 20.7.1. Displaying the function’s description
- 20.7.2. Argument descriptions
- 21. Creating Excel Add-Ins
- 21.1. Okay . . . So What’s an Add-In?
- 21.2. Why Create Add-Ins?
- 21.3. Working with Add-Ins
- 21.4. Add-In Basics
- 21.5. An Add-In Example
- 21.5.1. Setting up the workbook
- 21.5.2. Testing the workbook
- 21.5.3. Adding descriptive information
- 21.5.4. Protecting the VBA code
- 21.5.5. Creating the add-in
- 21.5.6. Opening the add-in
- 21.5.7. Distributing the add-in
- 21.5.8. Modifying the add-in
- 22. Ten VBA Questions (And Answers)
- 23. (Almost) Ten Excel Resources
- 23.1. The VBA Help System
- 23.2. Microsoft Product Support
- 23.3. Internet Newsgroups
- 23.4. Internet Web Sites
- 23.5. Excel Blogs
- 23.6. Google
- 23.7. Bing
- 23.8. Local User Groups
- 23.9. My Other Books
Online LIVE Training Programming Course offered by INCAPROG ONLINE - www.incaprog.com - contacto@incaprog.com - Phone : (954) 727-3141