From the course: Excel: Learning VBA
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Define arrays - Microsoft Excel Tutorial
From the course: Excel: Learning VBA
Define arrays
- [Instructor] Most of the variables you create in Excel VBA will hold single values. That could be an item price or a shipping rate. However, you will often also deal with sets of values of the same type, such as multiple shipping rates. You can do that by creating a data structure called an array. In this movie, I will show you several ways that you can create and work with arrays. My sample file is "02_06_Arrays". And you can find it in the Chapter Two folder of the Exercise Files collection. This workbook contains two worksheets, and for one I have different shipping costs based on the maximum weight of a package. And then on sheet two, I have the same thing except now I have maximum weight for a package and also the zone where it's going. So, you might think of this as a two dimensional array. Instead of a simple column of numbers, I have a column in the vertical direction and also rows in the horizontal direction.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Introduce Excel VBA data types4m 5s
-
(Locked)
Declare variables and require declaration before use5m 27s
-
(Locked)
Manage variable scope3m 50s
-
(Locked)
Define static variables and constants5m 42s
-
Create a calculation using mathematical operators5m 10s
-
(Locked)
Define arrays7m 10s
-
Define and use object variables3m 3s
-
(Locked)
Streamline code references using With…End With statements4m 40s
-
(Locked)
Challenge: Define variables, constants, and calculations2m 5s
-
(Locked)
Solution: Define variables, constants, and calculations3m 13s
-
(Locked)
-
-
-
-
-
-