Be the first user to complete this post

  • 0
Add to List

VBA-Excel: Arrays – Multi Dimensional Array

Multi Dimensional array has more than 2 dimensions.

For creating multi dimensional array, Follow the below status:

  • Declare the multi dimensional Array
  • Store values in array
  • Retrieve values from array

Declare the multi dimensional Array

Dim arrMatrix(1 To 9, 1 To 3, 1 To 3)

Store values in array

arrMatrix(1, 1, 1) = mainWorkBook.Sheets("Sheet1").Range("E5").Value

arrMatrix(1, 2, 1) = mainWorkBook.Sheets("Sheet1").Range("E6").Value

Retrieve values from array

      Msgbox  arrMatrix(1, 2, 1)

Example:  SUDOKU Solver

Multi Dimensional Array - SUDOKU SOLVER
Multi Dimensional Array - SUDOKU SOLVER



Also Read:

  1. VBA Excel - Cells, Ranges and Offset: Refer to Cells by Using Shortcut Notation
  2. VBA-Excel: Date-Time Functions – WeekDay() and WeekDayName()
  3. VBA-Excel: Delete Blank Rows from Excel Work Sheet
  4. VBA-Excel : Strings Functions – Right
  5. VBA-Excel : Strings Functions – Left
  6. VBA-Excel: Date-Time Functions – Date(), Now() and Time()
  7. VBA-Excel: Date-Time Functions – DateDiff()
  8. VBA-Excel: Array Functions – Split()