Be the first user to complete this post
|
Add to List |
VBA-Excel: Fill Excel Range Values in a 2D Array
You can fill a range values from an excel work book into a two dimensional array. All you have to do is assign range values to a variable and then that variable will become array
![Two Dimensional Dynamic array -1](/static/media/excel/2013/10/Two-Dimensional-Dynamic-array-1.jpg)
Function FnFillValues()
arrTwoD2 = Sheet9.Range("A1: B5")
MsgBox "The value is B5 is " & arrTwoD2(3, 2)
End Function
![Two Dimensional Array -2](/static/media/excel/2013/10/Two-Dimensional-Array-2.jpg)
Also Read:
- Excel Macro - Visual Basic Editor
- VBA-Excel: Arrays – Two Dimension, Dynamic Array
- VBA-Excel: Array Functions – IsArray()
- VBA-Excel: Date-Time Functions – TimeSerial() and TimeValue()
- VBA-Excel: Date-Time Functions – Date(), Now() and Time()