Tag Archives: Arrays

For Loops in VBA and the Continue Statement

Loops in VBA Loops are an essential part of any programming language because they help with the repeated running of any code snippet. Just like any other language, VBA offers the following loops to enable efficient programming: Do until Do while For Foreach In this

How Do You Redim a Multidimensional Array?

Arrays are simply a collection of values or items that are stored in continuous memory locations. They’re a data structure in which a group of items stored with the same data type. This type of structure is highly useful in the programming world as it

How to Check if an Array Is Empty in VBA

When a list or collection of items that are the same data type are stored in continuous memory locations, we call it an array. Arrays are useful objects that are widely used in software development to organize data. Some real examples of where you might

What is a VBA Dictionary?

A dictionary is an object in VBA (similar to a collection) that stores data like an array. It can be used to store data of any type except an array. A VBA dictionary has two parts: Key Value …where key is simply a reference to the

The ReDim Statement in VBA

The ReDim statement is used to declare the size of a Dynamic array in VBA.  It can later be used to re-declare the size of the array as many times as you need.  It can only be used for Dynamic VBA Arrays (where the size

No Thumbnail

Excel VBA, Arrays and Ranges

When modifying worksheets and ranges,  one option would be to modify the worksheet directly using the commands I’v explained in the article Referencing Ranges In Excel Using VBA but that would be very inefficient. Every time you read or write something to an excel sheet, you will be consuming considerable

No Thumbnail

VBA Arrays and Userdefined Functions and Subs

In this article I will cover the following topics: Passing Arrays as Input Parameters to Functions and Subs ByRef Passing Arrays as Input Parameters to Functions and Subs ByVal Getting the dimension of the Input Array to Function or Sub: Declaring Functions With an Array