in your for loop use a Redim on the array like here:
For i = 0 to 3
ReDim Preserve test(i)
test(i) = 3 + i
Next i
More Related Contents:
- Excel-VBA – Insert new first column in datafield array without loops or API calls
- Creating an Array from a Range in VBA
- Expanding column cells for each column cell
- How do I slice an array in Excel VBA?
- Check if a value is in an array or not with Excel VBA
- How to search for string in an array
- Sorting a multidimensionnal array in VBA
- How do I set up a “jagged array” in VBA?
- Matching values in string array
- Declare and Initialize String Array in VBA
- Deleting Elements in an Array if Element is a Certain value VBA
- How to automatically input an array formula as string with more than 255 characters in length into an excel cell using VBA?
- Writing an array to a range. Only getting first value of array
- Faster way of using Sumifs()
- How to initialize a multidimensional array variable in vba for excel
- VBA using ubound on a multidimensional array
- Turn Excel range into VBA string
- Get values from union of non-contiguous ranges into array with VBA with a simple command (no loops)
- Why am I having issues assigning a Range to an Array of Variants
- VBA Excel large data manipulation taking forever
- Performance difference between looping range vs looping array
- how to combine duplicate rows and sum the values 3 column in excel
- Dynamically Dimensioning A VBA Array?
- Create Chart from Array data and not range
- VBA – Returning array from Property Get
- How do I Merge two Arrays in VBA?
- Excel VBA Quickest way to sort an array of numbers in descending order?
- Simple VBA array join not working
- Excel VBA – How to Redim a 2D array?
- ReDim Preserve “Subscript Out of Range”