title: how do i make excel vba move to the next cell in a for loop?
body: <p>I have here the code for a Macro that does some data pick and place from one worksheet to another. Right now this code does 90% of what I want it to do. The problem is that if it encounters a source cell that has nothing in it (Hence <code>Len(cellVal) = 0</code> and <code>cellVal = ""</code> it overwrites the destination cell. </p>
  
  <p>You will see that at the second ElseIf block there is a comment. Right now it does nothign but if the statement evaluates to true, i.e. there is nothing in the source cell, I want Excel to move on to the next source cell WITHOUT modifying the destination cell's contents. </p>
  
  <p>Any ideas on how this might be accomplished? </p>
  
  <p>Franklin</p>
  
  <pre><code>For i = 7 To endPointFlash
      Dim cellVal As String
      cellVal = Cells(i, "G")
  
      If (Len(cellVal)) &gt; 0 Then
          RawData.Activate
      ElseIf (Len(cellVal)) = 0 Or cellVal = "" Then
          ' need to tell excel to do nothing and move to the next cell
      End If
  
      For j = 1 To endPointRaw
          If cellVal = Mid(Cells(j, "A"), 1, Len(cellVal)) Then
              val2 = Mid(Cells(j, "A"), 1, Len(cellVal))
              val3 = Cells(j, "D")
              Flash.Cells(i, "H").Value = val3
              Exit For
          Else: Flash.Cells(i, "H").Value = 0
          End If
      Next j
  Flash.Activate
  Next i
  </code></pre>