The examples below are intended to illustrate a broad range of functionality in Excel VBA.  Ideally, you should view them in a linear fashion.  Each example builds on the previous example to some degree.

vba_ex1.zip

  • Copying data within a worksheet
  • Using String, Integer, and Double data types
  • Using the Click and MouseMove events
  • Using an If...Then statement
  • Making basic calculations using code
  • Introduction to the Button control

vba_ex2.zip

  • Changing worksheet properties with code
  • Using Long, Single, and Boolean data types
  • Using the GotFocus and LostFocus events
  • Using a Select...Case statement
  • Making calculations involving exponents, square roots, and logarithms
  • Introduction to the TextBox control

vba_ex3.zip

  • Modifying large sections of the worksheet with code
  • Assigning variable types to each other
  • Using the KeyUp and KeyDown events
  • Using a For...Next loop
  • Making calculations involving absolute values, sine, cosine, and tangent
  • Introduction to the CheckBox control

vba_ex4.zip

  • Merge and unmerge cell blocks with code
  • Generate random numbers in a given interval
  • Using the Change event and determining string length
  • Using a Do...While loop
  • Rounding numbers to the nth digit
  • Introduction to the ListBox control

vba_ex5.zip

  • Copying large pieces of data within worksheets using code
  • Introduction to arrays
  • Introduction to worksheet events
  • Introduction to handling errors
  • Reading specific pieces of a string
  • Using the ScrollBar control