(Solved) – How to find the length of an array vba

Sub Test4()

Public Function GetLength(a As Variant) As Integer
   If IsEmpty(a) Then
      GetLength = 0
      GetLength = UBound(a) - LBound(a)   1
   End If

End Function

Essentially trying to find the length of two arrays, and am a little confused on how to use this code to do so. Unsure of what to place where and how to make it work without errors. Any help would be appreciated!

Leave a Reply

Your email address will not be published. Required fields are marked *