SyntaxFix
Write A Post
Hire A Developer
Questions
You need to deal with the optional Rank parameter of UBound.
UBound
Dim arr(1 To 4, 1 To 3) As Variant Debug.Print UBound(arr, 1) '? returns 4 Debug.Print UBound(arr, 2) '? returns 3
More at: UBound Function (Visual Basic)