Just define the variable as a variant, and make them equal:
Dim DirArray As Variant
DirArray = Range("a1:a5").Value
No need for the Array command.
More Related Contents:
- Excel VBA: Range to String Array in 1 step
- Create Chart from Array data and not range
- Excel-VBA – Insert new first column in datafield array without loops or API calls
- 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
- Matching values in string array
- Deleting Elements in an Array if Element is a Certain value VBA
- Is it possible to fill an array with row numbers which match a certain criteria without looping?
- How to automatically input an array formula as string with more than 255 characters in length into an excel cell using VBA?
- Return Index of an Element in an Array Excel 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
- Subscript out of range error with an array – no idea why?
- VBA Excel large data manipulation taking forever
- Performance difference between looping range vs looping array
- 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”
- Convert an entire range to uppercase without looping through all the cells
- How to search for string in an array
- Detect if range is empty
- Is there a way to instantly generate an array filled with a range of values in Swift?
- Copy a selected range to another worksheet