By using vba.booksticle.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

948 Steps to 6 Figures by Learning Excel-VBA and Other Skills



Step - Variables


Variables are temporary storage location or a way for a program to store and memorize something.

Variables can be declared and then set, but declaring is optional.

You name them, but you should give them a name that's meaningful or else when you look at your program in a few months you might not know what it means.


a = 1

s = "12345"

t = 12345tax_rate = 8.25

debug.print a, s, t ' will print the values of the 3 variable to the immediate window

Some variables I commonly use.
  • i ' a for loop variable
  • j
  • x ' a sequential file number
  • y
  • sFile ' a file name
  • r ' a row number
  • c ' a column number


  •    Table of Contents | Send us your feedback | © 2025 All Rights Reserved | Edit