Be the first user to complete this post

  • 0
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
Two Dimensional Dynamic array -1

Function FnFillValues()

    arrTwoD2 = Sheet9.Range("A1: B5")   

MsgBox "The value is B5 is " & arrTwoD2(3, 2)

End Function

Two Dimensional Array -2
Two Dimensional Array -2



Also Read:

  1. VBA-Excel: Create a WorkBook at Runtime.
  2. VBA-Excel: Date-Time Functions – DateDiff()
  3. VBA-Excel: Date-Time Functions – DatePart()
  4. VBA-Excel : 3D-Ranges - Working with Multiple WorkSheets At The Simultaneously
  5. VBA-Excel: Create Dynamic or Run-time WorkSheets using Macro.
  6. VBA-Excel: Get all the WeekDays or Working days in Specified Date Range, (excluding Satudays and Sundays)
  7. VBA-Excel: Modified Consolidator – Merge or Combine Multiple Excel Files Into One Where Columns Are Not In Order
  8. VBA Excel - Cells, Ranges and Offset : Offset