Page 739 - Excel 2013 All-in-One For Dummies
P. 739

Chapter 2: VBA Programming In This Chapter
✓ Getting familiar with Visual Basic for Applications and the Visual Basic Editor
✓ Editing a macro in the Visual Basic Editor
✓ Creating a dialog box that prompts you for input for your macro
✓ Writing new macros in the Visual Basic Editor
✓ Using VBA to create user-defined functions
✓ Using your user-defined functions in your spreadsheets
✓ Saving user-defined functions as Excel add-ins
The subject of this chapter is Visual Basic for Applications (usually known simply as VBA), which is the official programming language of Excel, and how you can use it to edit the macros that you record (as described in Book VIII, Chapter 1) as well as to write new macros. The key to editing and writing macros in VBA is its editing program, the Visual Basic Editor (often abbrevi- ated as VBE). The Visual Basic Editor offers a rich environment for coding and debugging VBA code with an interface that rivals Excel itself in terms of features and complexity.
VBA is a huge subject, well beyond the scope of this book. In this chapter,
I simply introduce you to the Visual Basic Editor, and I explain how to use
it to do basic macro editing. I also show you how to use the Visual Basic Editor to create custom Excel functions that you can then use when building formulas in your Excel spreadsheets. Custom functions (also known as user- defined functions or UDFs) work just like built-in functions except that they perform only the calculations that you define, by using just the arguments that you specify.
If this basic introduction to Visual Basic for Applications and using the Visual Basic Editor inspires you to go on and try your hand at real VBA project development in Excel, I recommend Excel 2013 VBA Programming For Dummies, by John Walkenbach (Mr. Spreadsheet, himself) and Jan Karel Pieterse as an excellent next step. Their book gives you the lowdown on all the ins and outs of VBA programming in that old, familiar, down-home For Dummies style that you’ve come to know and love.
 





















































































   737   738   739   740   741