I'll attempt a slightly simpler explanation, just in case you didn't quite get it from that one.
I'll assume you have encountered variables, and have some idea of what they are for.
Let's say you have a hundred variables, holding the same piece of information about a hundred objects. You decide that for whatever reason, you need to add 1 to each of them.
Using individual variables, you would have to write a hundred lines of code.
- Variable1 = Variable1 + 1
-
Variable2 = Variable2 + 1
-
Variable3 = Variable3 + 1
-
.
-
.
-
.
-
Variable100 = Variable100 + 1
You can see that this would quickly make your code too long and cumbersome to work with. Plus you would have to know, when writing the code, how many objects there will be.
An array, on the other hand, looks kind of like one variable, but you use an
index to refer to multiple "instances" of it, which can hold different values. That means you can do neat things like using loops. To take the same example of modifying 100 objects from above...
- For Index = 1 To 100
-
ArrayVariable(Index) = ArrayVariable(Index) + 1
-
Next
I'm sure you'll agree that three lines of code are much easier to read (and type). And for all sorts of reasons, this is much more flexible. For example, the "1" and "100" limits on this loop could be values from other variables, so they can change while the program is running, without having to rewrite the code.