James Patterson is the #1 New York Times bestselling author of many books, including the blockbuster series MAXIMUM RIDE. More than 100 million of his books are in print around the world, making him one of the top-selling writers of all time.
You can refer a name range in VBA code like below: Range(â<range name>â) Above statement returns a 2 dimensional array which is holding all the values in the named range in (x, y) format where x = Row, y= Column. Note: If named range is having only one cell then Range(â<range name>â) will return that one value.
By definition, an array is a group of variables with the same data type and name. We differentiate each item in the array by using subscript, the index value of each item, for example name (1), name (2), name (3) .......etc. 21.2 Declaring Arrays in Excel VBA. We use Dim statement to declare an array just as the way we declare a single variable.In VBA, we can have a one dimensional array, two dimensional array or even a multidimensional array (up to 60) 21.2(a) One Dimensional Array. The general statements to declare a one dimensional array in Excel VBA is as follows: