• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 31. Recording Macros > Macro Subroutines

Macro Subroutines

Suppose you're creating a complex macro and you discover that, among other things, you want the macro to perform a task you've already recorded under a different name. Or suppose you discover that a task you've recorded as part of a macro is something you'd like to use by itself. In our CompanyAddress macro, for example, it might be nice if we could quickly and easily apply the font formats of the company name to other items in a worksheet.

With VBA, you can conveniently divide large macros into a series of smaller macros, and you can easily string together a series of small macros to create one large macro. A macro procedure that is used by another macro is called a subroutine. Macro subroutines can simplify your macros because you have to write only one set of instructions rather than repeat the instructions over and over. To use a macro subroutine in another macro, you call the subroutine by using its name in the other macro.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint