>>382
うろ覚えだけどVarTypeでvbArrayとして返ってきた場合でもUboundするとエラーになるケースがあったはずなので、
Uboundを使う場合は別関数でOn Error Gotoで飛ばせるようにしておきたい。

Function SafeUBound(hoge, Optional div As Long) As Long
On Error GoTo fin
If div = 0 Then div = 1
SafeUBound = -1
SafeUBound = UBound(hoge, div)
fin:
End Function

Function SafeLBound(hoge, Optional div As Long) As Long
On Error GoTo fin
If div = 0 Then div = 1
SafeLBound = 0
SafeLBound = LBound(hoge, div)
fin:
End Function

と置いてSafeUbound < SafeLBoundで判定したい。