Here is a sample of what you will find
VBA Code for Variables
You will start developing complex and sophisticated programs in Excel and you will start working with very large sets of data when you discover the variables.
A variable is an object that you create and in which you can store text, dates, numbers or almost anything else. Why should you use variable? The first good reason is to make your code dynamic, to avoid hard coding some values.
Hard Coding vs Dynamic Coding
You are hard coding when you write:
You are dynamically coding when you enter the name of the file in an cell (A1) of your Excel sheet and you write.
You will also create variables to count the number of rows, store the result in a variable and then do something as many time as there are rows.
For varCounter = 1 to varNbRows
In the VBA procedure above the value in each cell is multiplied by 2 then the cell below is selected. This action is repeated as many times as there are rows in the set of data.
We hope you have enjoyed this tip
To organize your discovery of Excel macros, the downloadable Tutorial on Excel Macros is divided in three sections (all 3 sections part of the single download):
Section 1: Excel Macros Programming (Chapters 1 to 10)
Section 2: Excel VBA Vocabulary (Chapters 11 to 23)
Section 3: Forms and Controls in VBA for Exce (Chapters 24 to 33)