E-Learning Excel VBA Programming Lesson 4
E-Learning Excel VBA Programming Lesson 4
th 4
Session
End Sub
Sub macro1()
Declaring Variables
A Variable is used to store temporary information that is used for execution within the Procedure, Module or Workbook. Before we go into some detail of Variables, there are a few important rules that you must know about. A Variable name must Start with a letter and not a number. Numbers can be included within the name, but not as the first character.
Example: Dim myBirthDate As Date Dim myBirthTime As Date myBirthDate = #8/23/59# myBirthTime = #3:02 AM#