Book description
Newly updated for Excel 2002, Writing Excel Macros with VBA, 2nd Edition provides Excel power-users, as well as programmers who are unfamiliar with the Excel object model, with a solid introduction to writing Visual Basic for Applications (VBA) macros and programs for Excel. In particular, the book focuses on:
- The Visual Basic Editor and the Excel VBA programming environment. Excel features a complete, state-of-the-art integrated development environment for writing, running, testing, and debugging VBA macros.
Publisher resources
Table of contents
- A Note Regarding Supplemental Files
- Preface
- 1. Introduction
-
I. The VBA Environment
- 2. Preliminaries
- 3. The Visual Basic Editor, Part I
-
4. The Visual Basic Editor, Part II
- 4.1. Navigating the IDE
- 4.2. Getting Help
- 4.3. Creating a Procedure
- 4.4. Run Time, Design Time, and Break Mode
- 4.5. Errors
-
4.6. Debugging
-
4.6.1. Tracing
- 4.6.1.1. Stepping into
- 4.6.1.2. Step Over (Shift-F8 or choose Step Over from the Debug menu)
- 4.6.1.3. Step Out (Ctrl-Shift-F8 or choose Step Out from the Debug menu)
- 4.6.1.4. Run To Cursor (Ctrl-F8 or choose Run To Cursor from the Debug menu)
- 4.6.1.5. Set Next Statement (Ctrl-F9 or choose Set Next Statement from the Debug menu)
- 4.6.1.6. Breaking out of Debug mode
- 4.6.2. Watching Expressions
-
4.6.1. Tracing
- 4.7. Macros
-
II. The VBA Programming Language
-
5. Variables, Data Types, and Constants
- 5.1. Comments
- 5.2. Line Continuation
- 5.3. Constants
-
5.4. Variables and Data Types
- 5.4.1. Variable Declaration
- 5.4.2. The Importance of Explicit Variable Declaration
- 5.4.3. Numeric Data Types
- 5.4.4. Boolean Data Type
- 5.4.5. String Data Type
- 5.4.6. Date Data Type
- 5.4.7. Variant Data Type
- 5.4.8. Excel Object Data Types
- 5.4.9. Arrays
- 5.4.10. Variable Naming Conventions
- 5.4.11. Variable Scope
- 5.4.12. Variable Lifetime
- 5.4.13. Variable Initialization
- 5.5. VBA Operators
- 6. Functions and Subroutines
- 7. Built-in Functions and Statements
- 8. Control Statements
-
5. Variables, Data Types, and Constants
-
III. Excel Applications and the Excel Object Model
- 9. Object Models
- 10. Excel Applications
- 11. Excel Events
-
12. Custom Menus and Toolbars
- 12.1. Menus and Toolbars: An Overview
- 12.2. The CommandBars Collection
- 12.3. Creating a New Menu Bar or Toolbar
- 12.4. Command-Bar Controls
- 12.5. Built-in Command-Bar-Control IDs
- 12.6. Example: Creating a Menu
- 12.7. Example: Creating a Toolbar
- 12.8. Example: Adding an Item to an Existing Menu
- 12.9. Augmenting the SRXUtils Application
- 13. Built-In Dialog Boxes
-
14. Custom Dialog Boxes
- 14.1. What Is a UserForm Object?
- 14.2. Creating a UserForm Object
- 14.3. ActiveX Controls
- 14.4. Adding UserForm Code
- 14.5. Excel’s Standard Controls
- 14.6. Example: The ActivateSheet Utility
- 14.7. ActiveX Controls on Worksheets
- 15. The Excel Object Model
-
16. The Application Object
-
16.1. Properties and Methods of the Application Object
- 16.1.1. Members that Return Children
- 16.1.2. Members that Affect the Display
- 16.1.3. Members that Enable Excel Features
- 16.1.4. Event-Related Members
- 16.1.5. Calculation-Related Members
- 16.1.6. File-Related Members
- 16.1.7. Members that Affect the Current State of Excel
- 16.1.8. Members that Produce Actions
- 16.1.9. Miscellaneous Members
- 16.2. Children of the Application Object
-
16.1. Properties and Methods of the Application Object
-
17. The Workbook Object
- 17.1. The Workbooks Collection
-
17.2. The Workbook Object
- 17.2.1. Activate Method
- 17.2.2. Close Method
- 17.2.3. DisplayDrawingObjects Property
- 17.2.4. FileFormat Property (Read-Only Long )
- 17.2.5. Name, FullName, and Path Properties
- 17.2.6. HasPassword Property (Read-Only Boolean)
- 17.2.7. PrecisionAsDisplayed Property (R/W Boolean)
- 17.2.8. PrintOut Method
- 17.2.9. PrintPreview Method
- 17.2.10. Protect Method
- 17.2.11. ReadOnly Property (Read-Only Boolean)
- 17.2.12. RefreshAll Method
- 17.2.13. Save Method
- 17.2.14. SaveAs Method
- 17.2.15. SaveCopyAs Method
- 17.2.16. Saved Property (R/W Boolean)
- 17.3. Children of the Workbook Object
- 17.4. Example: Sorting Sheets in a Workbook
- 18. The Worksheet Object
-
19. The Range Object
- 19.1. The Range Object as a Collection
- 19.2. Defining a Range Object
-
19.3. Additional Members of the Range Object
- 19.3.1. Activate Method
- 19.3.2. AddComment Method
- 19.3.3. Address Property (Read-Only String)
- 19.3.4. AutoFill Method
- 19.3.5. AutoFilter Method
- 19.3.6. AutoFit Method
- 19.3.7. AutoFormat Method
- 19.3.8. BorderAround Method
- 19.3.9. Calculate Method
- 19.3.10. Clear Methods
- 19.3.11. ColumnDifferences and RowDifferences Methods
- 19.3.12. ColumnWidth and RowHeight Properties
- 19.3.13. Width, Height, Top, and Left Properties
- 19.3.14. Consolidate Method
- 19.3.15. Copy and Cut Methods
- 19.3.16. CopyFromRecordset Method
- 19.3.17. CreateNames Method
- 19.3.18. CurrentRegion Property
- 19.3.19. Delete Method
- 19.3.20. Dependents and DirectDependents Properties
- 19.3.21. Precedents and DirectPrecedents Properties
- 19.3.22. End Property
- 19.3.23. EntireColumn and EntireRow Properties
- 19.3.24. Fill Methods
- 19.3.25. Find Method
- 19.3.26. FindNext and FindPrevious Methods
- 19.3.27. Formula and FormulaR1C1 Properties
- 19.3.28. FormulaArray Property
- 19.3.29. FormulaHidden Property (R/W Boolean)
- 19.3.30. HasFormula Property (Read-Only)
- 19.3.31. HorizontalAlignment Property
- 19.3.32. IndentLevel Property and InsertIndent Method
- 19.3.33. Insert Method
- 19.3.34. Locked Property
- 19.3.35. Merge-Related Methods and Properties
- 19.3.36. Next and Previous Properties
- 19.3.37. NumberFormat Property
- 19.3.38. Parse Method
- 19.3.39. PasteSpecial Method
- 19.3.40. PrintOut Method
- 19.3.41. PrintPreview Method
- 19.3.42. Replace Method
- 19.3.43. Select Method
- 19.3.44. ShrinkToFit Property
- 19.3.45. Sort Method
- 19.3.46. SpecialCells Method
- 19.3.47. TextToColumns Method
- 19.3.48. Value Property
- 19.3.49. WrapText Property
-
19.4. Children of the Range Object
- 19.4.1. The Areas Collection
- 19.4.2. The Borders Collection
- 19.4.3. The Border Object
- 19.4.4. The Characters Object
- 19.4.5. The Comment Object
- 19.4.6. The Font Object
- 19.4.7. The FormatConditions Collection
- 19.4.8. The Interior Object
- 19.4.9. The PivotField, PivotItem, and PivotTable Objects
- 19.4.10. The QueryTable Object
- 19.4.11. The Validation Object
- 19.5. Example: Getting the Used Range
- 19.6. Example: Selecting Special Cells
-
20. Pivot Tables
- 20.1. Pivot Tables
- 20.2. The PivotTable Wizard
- 20.3. The PivotTableWizard Method
- 20.4. The PivotTable Object
-
20.5. Properties and Methods of the PivotTable Object
- 20.5.1. Returning a Fields Collection
- 20.5.2. Totals-Related Members
- 20.5.3. Returning a Portion of a PivotTable
- 20.5.4. PivotSelect and PivotSelection
-
20.5.5. Additional Members of the PivotTable Object
- 20.5.5.1. AddFields method
- 20.5.5.2. CalculatedFields method
- 20.5.5.3. Errors-related properties
- 20.5.5.4. Null-related properties
- 20.5.5.5. EnableDrillDown property
- 20.5.5.6. Formatting properties and methods
- 20.5.5.7. Refreshing a pivot table
- 20.5.5.8. PageField-related properties
- 20.5.5.9. Name property
- 20.5.5.10. SaveData property (R/W Boolean)
- 20.5.5.11. ShowPages method
- 20.5.5.12. SourceData property
- 20.6. Children of the PivotTable Object
-
20.7. The PivotField Object
- 20.7.1. AutoShow-Related Members
- 20.7.2. Sorting Pivot Fields
- 20.7.3. The Fundamental Properties
- 20.7.4. Selecting Ranges
- 20.7.5. Dragging Pivot Fields
- 20.7.6. Name, Value, and SourceName Properties
- 20.7.7. Grouping
- 20.7.8. Data Field Calculation
- 20.7.9. CurrentPage Property
- 20.7.10. DataType Property
- 20.7.11. HiddenItems and VisibleItems Properties
- 20.7.12. MemoryUsed Property
- 20.7.13. ServerBased Property
- 20.7.14. ShowAllItems Property
- 20.7.15. Subtotals Method
- 20.8. The PivotCache Object
- 20.9. The PivotItem Object
- 20.10. PivotCell and PivotItemList Objects
- 20.11. Calculated Items and Calculated Fields
- 20.12. Example: Printing Pivot Tables
-
21. The Chart Object
- 21.1. Chart Objects and ChartObject Objects
- 21.2. Creating a Chart
- 21.3. Chart Types
- 21.4. Children of the Chart Object
- 21.5. The Axes Collection
-
21.6. The Axis Object
- 21.6.1. AxisGroup Property
- 21.6.2. Axis Titles and Their Formatting
- 21.6.3. CategoryNames Property
- 21.6.4. CategoryType Property and BaseUnit Property
- 21.6.5. Crosses and CrossesAt Properties
- 21.6.6. Display Units
- 21.6.7. Gridline-Related Properties and the Gridline Object
- 21.6.8. Position- and Dimension-Related Properties
- 21.6.9. Tick Mark-Related Properties
- 21.6.10. Units-Related Properties
- 21.6.11. ReversePlotOrder Property
- 21.6.12. Type Property
- 21.7. The ChartArea Object
- 21.8. The ChartGroup Object
- 21.9. The ChartTitle Object
- 21.10. The DataTable Object
- 21.11. The Floor Object
- 21.12. The Legend Object
- 21.13. The PageSetup Object
- 21.14. The PlotArea Object
- 21.15. The Series Object
- 21.16. Properties and Methods of the Chart Object
- 21.17. Example: Scrolling Through Chart Types
- 21.18. Example: Printing Embedded Charts
- 21.19. Example: Setting Data Series Labels
- 22. Smart Tags
-
IV. Appendixes
- A. The Shape Object
- B. Getting the Installed Printers
- C. Command Bar Controls
- D. Face IDs
- E. Programming Excelfrom Another Application
- F. High-Level and Low-Level Languages
-
G. New Objects in Excel XP
- AllowEditRange Object
- AutoRecover Object
- CalculatedMember Object
- CellFormat Object
- CustomProperty Object
- Diagram, DiagramNode and DiagramNodeChildren Objects
- Error Object
- ErrorCheckingOptions Object
- Graphic Object
- IRTDServer and IRTDUpdateEvent Objects
- PivotCell and PivotItemList Objects
- Protection Object
- RTD Object
- SmartTag Related Objects
- Speech Object
- SpellingOptions Object
- Tab Object
- UsedObjects Object
- UserAccessList andUserAccess Objects
- Watch Object
- Index
- Colophon
- Copyright
Product information
- Title: Writing Excel Macros with VBA, 2nd Edition
- Author(s):
- Release date: June 2002
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596003593
You might also like
book
Excel 2016 VBA and Macros
This is the Rough Cut version of the printed book. SAVE TIME AND SUPERCHARGE EXCEL 2016 …
book
Programming Excel with VBA and .NET
Why program Excel? For solving complex calculations and presenting results, Excel is amazingly complete with every …
book
Computing with Excel and VBA
Ideal for use in non-majors, introductory-level CS or CIS courses, Computing with Excel and VBA provides …
book
Excel 2013 Power Programming with VBA
Maximize your Excel 2013 experience using VBA application development The new Excel 2013 boasts updated features, …