how do we get the size of input range in Excel VBA?
Posted on 2015-01-30
I try to do something and need to have a range as input in VBA function. But when I use the function, it always gives me an error, what could be wrong.
rowSize = UBound(arr, 1) - LBound(arr, 1) + 1
colSize = UBound(arr, 2) - LBound(arr, 2) + 1
MsgBox ("input is a " & TypeName(arr) & "with size of " & rowSize & " X " & colSize & ".")
Please take a look.