title: Find First Empty Element in a String Array
body: <p>I am trying to use this code to determine the value of <code>Firstcell</code> but can't get an output: </p>
  
  <pre><code>Sub FindFirstEmptyCell()
  
      Dim l As Integer
      Dim Firstcell As Integer
      Dim MyArray(5) As String
      Dim currentRowValue As String
  
      MyArray(1) = "g"
      MyArray(2) = "g"
      MyArray(3) = "s"
      MyArray(4) = ""
      MyArray(5) = "f"
  
  
      For l = 0 To 5
              currentRowValue = MyArray(l)
          If IsEmpty(currentRowValue) = True Or currentRowValue = "" Then
               Firstcell = l: Exit For
          End If
      Next
  
  End Sub
  </code></pre>