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

Variables and Constants

During code playback, there are times when information that’s gathered from the user, returned by a function, or defined by the programmer must be stored temporarily for use later on. Sometimes, this information will change as the code is running. Other times, it will stay the same the entire time the code is running. Variables and constants are used to store this type of information during code playback.

What Is a Variable?

A variable is a temporary storage location in your computer’s memory for a piece of information used by a procedure. Certain procedures obtain different data each time they run. Suppose that you’ve written a procedure that asks the user for his or her name and places it in the footer of the current workbook. If many people use this procedure, the name will be different every time the procedure is run. These are the logical steps such a procedure would follow:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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