You need to be logged in to view this content. Please login or become a member.

<<  Prev   |   Index   |   Next  >>


Arrays are a convenient way to store multiple values in a single variable, making your job as a programmer much easier.


An alternative to arrays that is particularly useful when working with objects is the Collection. Items can be added or removed to collections very easily without any need to re-size the collection. Click here for an example.

Lesson Files

Lesson 1.3 code


Lesson 1.3 homework solution


  1. ChbutaI

    What’s the fastest way to populate multidimensional arrays? For example, instead of typing out the address of each array element and then equating it to a value: intArray(2,1) = 5 ….. Is there some way to put in all element values at once like this: intArray = [(5,8),(5,1)] ?

    • Good question. Unfortunately, I don’t know of a faster way. You might find some better help at You might possibly be able to reduce the amount of typing involved by using the Split() function, however.

      • jwiltshi

        Just in case anyone sees this and is wondering the same thing. A way to populate arrays using a for loop:
        ( straight from the VB built in help)

        Sub FillArray()
        Dim curExpense(364) As Currency
        Dim intI As Integer
        For intI = 0 to 364
        curExpense(intI) = 20
        End Sub

  2. OliverT

    Hi Keith,

    I have just gone through this lesson on Arrays.

    I get that you can have static or dynamic arrays and understand that by dynamic we essentially mean arrays that can be re-sized while the program is running (by using ReDim).

    However what I’m not clear on is why you might want to do this (i.e. with the second ReDim.).🤔

    If you can help add some clarity on this I’d be really grateful.

    Many thanks,


    • You use ReDim if you want to resize an array. I would recommend you use a Collection in VBA or a List in .NET, however, so you don’t have to worry about resizing arrays at all.

Questions and Comments

You must be logged in to post a comment.