From the course: Excel for Engineering Professionals

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Working with arrays

Working with arrays

- [Instructor] I discussed variables in this course, but as I said, data is plural and luckily programming languages have an effective way to work with more than one data point. You probably had to work with matrix calculations when you were studying to become an engineer. VBA allows you to use matrixes as well. It's just that regardless of the number of dimensions, they are called arrays. So in VBA, there are several ways to use arrays and I'll show you the first one right here. We start with declaring the array and that's done using this first line here. And in this particular example I'm defining the size of the array upfront. I'm telling VBA that this array is going to contain three elements, name list one, two, and three. And the code assigns the elements by their index number. as I show you here. This is an array with three elements, namely name list one, which I assigned here, name list two, which I assigned here…

Contents