0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ExcelVBA 1次元配列が空かどうか調べる関数

Posted at
'--- 配列が空の場合はTrueを返す関数 ---'
Public Function Is_Empty_Array(ByRef arrayTmp As Variant) As Boolean

On Error GoTo ERROR_

    'UBound関数を使用してエラーが発生するかどうかを確認
    If UBound(arrayTmp, 1) >= 0 Then
        Is_Empty_Array = False
    Else
        Is_Empty_Array = True
    End If

    Exit Function

ERROR_:

    'エラーが発生した場合
    Is_Empty_Array = True

End Function
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?