Hi guys, let's say i have an array called name(5)
What if i didn't initialize the entries of this array, how am I gonna check if, say, name(1) is defined?
Thanks!
Hi guys, let's say i have an array called name(5)
What if i didn't initialize the entries of this array, how am I gonna check if, say, name(1) is defined?
Thanks!
Hi,
You could check with the following code:
Let me know if you need any further assistance.Public Sub testForEmpty()
Dim myArray(3)
Dim item
Dim counter As Long
myArray(0) = "string value"
myArray(1) = 1.5
myArray(3) = False
For Each item In myArray
If IsEmpty(item) Then
Debug.Print "Item " & counter & " in the array is empty"
End If
counter = counter + 1
Next
End Sub
Whether they are Empty or not will partly depend on how the Array was defined.
If non-variant it won't be empty... if Variant then
@nnram123 - please use CODE tags rather than QUOTE tags for your VBA![]()
Please Login or Register to view this content.
@secondrate - please do not quote entire posts in your reply - clutters the board (and your thread)
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks