View Single Post
 
Old 11-25-2013, 02:44 PM
omahadivision omahadivision is offline Windows 7 32bit Office 2007
Novice
 
Join Date: Oct 2012
Posts: 28
omahadivision is on a distinguished road
Default How do you loop through an array with some empty values?

Hello,

This seems like a very simple question, but I can't figure it out. I am looping through a string array, looking for the part of the array which contains a "/" mark

Code:
i=0
Do Until i > 10
   If splitslash(i) Like "*[/]*" Then
   Range("H4").Value = splitslash(i)
       End If
    i = i + 1
    Loop
    End If
The only problem is that I don't know how many values are in the array, only that they are between 0 and 11. I always get a "subscript out of range" error message once the array reaches empty space. I've tried using null qualifiers and even filling the array with arbitrary values, but I'm totally stumped.
Reply With Quote