Chapter 14

Automating Tasks with Macros and VBA

So far in this book, you've learned about the many things you can do with Excel when working manually—everything from creating new workbooks to entering data in them to creating charts from that data.

Whatever kind of work you do in Excel, chances are good that you'll need to perform some tasks repeatedly. You can continue to perform them manually if you choose, but you may be able to save any amount of time and effort by automating them.

In this chapter, we'll look at how you can automate tasks by using macros and Visual Basic for Applications (VBA), the programming language included in Excel 2011 and the other Office 2011 applications. We'll look at how to record macros in general, then go through an example of recording a macro that you can open in the Visual Basic Editor and improve. I'll show you how to run the macros you record and create, and how to delete them when you no longer need them.

Macros and VBA are a huge topic, and in this chapter we have space only to scratch the surface. If you want to save as much time and effort as possible, you'll probably want to get a book that covers macros and VBA in detail. You'll find that macros and VBA enable you to automate almost any task you can perform when working interactively (in other words, normally) in Excel—and some tasks you can't perform when working interactively.

Along the way, I'll also mention a couple of other means of automating tasks in Excel and Mac OS X, and I'll show you how to add the Developer tab to the Ribbon so that you can give Visual Basic–related commands quickly.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.107.89