Читать книгу Excel VBA Programming For Dummies - Dick Kusleika - Страница 3
Excel® VBA Programming For Dummies® To view this book's Cheat Sheet, simply go to www.dummies.com and search for “Excel VBA Programming For Dummies Cheat Sheet” in the Search box. Table of Contents
Оглавление1 Cover
4 Introduction About This Book Foolish Assumptions Icons Used in This Book Beyond the Book Where to Go from Here
5 Part 1: Starting Excel VBA Programming Chapter 1: Getting to Know VBA Understanding VBA Basics Knowing What VBA Can Do Getting the Most from VBA Understanding VBA Concepts Ensuring Excel Compatibility Chapter 2: Building Simple Macros Displaying the Developer Tab Creating a Macro Preparing the Environment Recording a Macro Running the Macro Viewing a Macro in the Visual Basic Editor Modifying the Macro Saving Workbooks That Contain Macros Understanding Macro Security
6 Part 2: Employing VBA with Excel Chapter 3: Working in the Visual Basic Editor Getting to Know the Visual Basic Editor Working with the Project Explorer Working with a Code Pane Customizing the VBE Chapter 4: Introducing the Excel Object Model Working with the Excel Object Model Diving into Object Properties and Methods Finding Out More from VBA Resources Chapter 5: VBA Sub and Function Procedures Understanding Subs versus Functions Naming Subs and Functions Executing Sub procedures Executing Function Procedures Chapter 6: Using the Excel Macro Recorder Recording Basics Preparing to Record Choosing Between Relative and Absolute Mode Watching the Macro Recorder in Action Specifying Recording Options for Your Macro Streamlining Code Generated by the Macro Recorder
7 Part 3: Programming Concepts Chapter 7: Essential VBA Language Elements Using Comments in Your VBA Code Using Variables, Constants, and Data Types Using Assignment Statements Working with Arrays Using Labels Chapter 8: Working with Range Objects Referring to Range Objects Referring to a Range Using Properties Working with Range Object Properties Taking Action with Range Object Methods Chapter 9: Using VBA and Worksheet Functions Understanding Functions Using Built-In VBA Functions Using Worksheet Functions in VBA Using Custom Functions Chapter 10: Controlling Program Flow and Making Decisions Going with the Flow, Dude The GoTo Statement Decisions, Decisions Knocking Your Code for a Loop Using For Each-Next Loops with Collections Chapter 11: Automatic Procedures and Events Preparing for the Big Event Knowing Where to Put the Event Code Writing an Event-Handler Procedure Triggering Workbook Events Using Activation Events Programming Worksheet-Related Events Understanding Events Not Associated with Objects Chapter 12: Error-Handling Techniques Types of Errors An Erroneous Macro Example Alternate Ways of Handling Errors Handling Errors: The Details An Intentional Error Chapter 13: Bug Extermination Techniques Species of Bugs Identifying Bugs Debugging Techniques Using the Debugger’s Tools Bug Reduction Tips Chapter 14: VBA Programming Examples Working with Ranges Changing Excel Settings Working with Charts VBA Speed Tips
8 Part 4: Communicating with Your Users Chapter 15: Simple Dialog Boxes Interacting with the User in VBA Displaying Messages with the MsgBox Function Getting Data with an Input Box Allowing the User to Select a File or Folder Displaying Excel’s Built-In Dialog Boxes Chapter 16: UserForm Basics Knowing When to Use a UserForm Creating UserForms: An Overview Working with UserForms A UserForm Example Chapter 17: Using UserForm Controls Getting Started with Dialog Box Controls Learning Dialog Box Controls Details Working with Dialog Box Controls Dialog Box Aesthetics Chapter 18: UserForm Techniques and Tricks Using Dialog Boxes A UserForm Example A ListBox Control Example Selecting a Range Using Multiple Sets of Option Buttons Using a Spin Button and a Text Box Using a UserForm as a Progress Indicator Creating a Modeless Tabbed Dialog Box Displaying a Chart in a UserForm A Dialog Box Checklist Chapter 19: Accessing Your Macros through the User Interface Customizing the Ribbon Customizing the Excel UI with VBA
9 Part 5: Putting It All Together Chapter 20: Creating Worksheet Functions Create Custom Functions to Simplify Your Work Understanding VBA Function Basics Writing Functions Working with Function Arguments Introducing Wrapper Functions Working with Functions That Return an Array Using the Insert Function Dialog Box Chapter 21: Creating Excel Add-Ins Add-Ins Defined Reasons to Create Add-Ins Working with Add-Ins Understanding Add-In Basics Looking at an Add-In Example
10 Part 6: The Part of Tens Chapter 22: Ten Handy Visual Basic Editor Tips Applying Block Comments Copying Multiple Lines of Code at Once Jumping between Modules and Procedures Teleporting to Your Functions Staying in the Right Procedure Stepping through Your Code Stepping to a Specific Line in Your Code Stopping Your Code at a Predefined Point Seeing the Beginning and End of Variable Values Turning Off Auto Syntax Check Chapter 23: Resources for VBA Help Letting Excel Write Code for You Referencing the Help System Pilfering Code from the Internet Leveraging User Forums Visiting Expert Blogs Mining YouTube for Video Training Attending Live and Online Training Classes Learning from the Microsoft Office Dev Center Dissecting the Other Excel Files in Your Organization Asking Your Local Excel Guru Chapter 24: Ten VBA Do’s and Don’ts Do Declare All Variables Don’t Confuse Passwords with Security Do Clean Up Your Code Don’t Put Everything in One Procedure Do Consider Other Software Don’t Assume That Everyone Enables Macros Do Get in the Habit of Experimenting Don’t Assume That Your Code Will Work with Other Excel Versions Do Keep Your Users in Mind Don’t Forget about Backups
11 Index