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

Writing Your Own Code

Now that you know about the macro recorder and the VBE, it is time to write some of your own code that cannot be written solely with the macro recorder. You may encounter several situations when you need to write your own code. Here are two examples:

  • When you don't know how many times you need to perform an operation. For example, when printing of a series of files, you will likely have a varying number of files from day to day, and they will likely have different names from day to day. In a case like this, it would be handy to be able to tell the program to print all the files in the specific directory and to stop when it has printed them all.

  • When you have to decide what action to take based on a condition that you cannot predict. For example, you might not be able to make a decision about what presentation design to apply until you know whether a financial statement shows a profit or a loss.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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