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.
In the code above, the variable name is MyArray. A pair of round brackets follows the variable name. VBA takes this to mean that you want to set up an array. The number of values you want to store using your variable name is typed between the round brackets. However, one important point to bear in mind is that the first position in the array is 0. So the above array can actually hold 5 values, 0 to 4.