title: VBA code to skip certain values and replace with subsequent qualifying value
body: <p>Good day,</p>
  
  <p>I'm very new to coding and completely brand new to coding stuff with vba macros.  After discovering the usefulness of vba in excel, I am now making a effort to learn more about it. Any help or assistance would be very much appreciated. </p>
  
  <p>This is the code I am working with so far:</p>
  
  <pre><code>Option Explicit
  
  Const initrow As Integer = 3
  Const ENDROW As Long = 65536
  Const PrimaryLengthCol As Integer = 1 '"A"
  
  Sub Test()
  
      Dim lastrow As Double
      Dim i As Double
      Dim irow As Double
  
      lastrow = Cells(Rows.Count, "A").End(xlUp).Row
  
      Application.ScreenUpdating = False
  
      irow = 0
      i = 0
      For i = 0 To lastrow
          If Cells(initrow + irow, PrimaryLengthCol + 2) = "BLANK" Then
              Continue For
              Cells(initrow + i, PrimaryLengthCol + 3).Value = Cells(initrow + irow, PrimaryLengthCol + 2).Value
          End If
      Next
  
  End Sub
  </code></pre>
  
  <p>So essentially the problem I'm encountering is the following:</p>
  
  <p>I have the following in Column "A" (Input column):</p>
  
  <ul>
  <li>0</li>
  <li>14.155</li>
  <li>14.128</li>
  <li>15.589</li>
  <li>BLANK</li>
  <li>BLANK</li>
  <li>BLANK</li>
  <li>15.158</li>
  </ul>
  
  <p>I need the vba code to LOOP through each cell and if the cell is equals to "BLANK" (text string) then the corresponding cell would take the subsequent number.  In addition, if the value from column "A" is equal to zero then output is equal to "void" in column "B".  </p>
  
  <p>So the desired output in column "B" (Output Column) would need to be:</p>
  
  <ul>
  <li>Void</li>
  <li>14.155</li>
  <li>14.128</li>
  <li>15.589</li>
  <li>15.158</li>
  <li>15.158</li>
  <li>15.158</li>
  <li>15.158</li>
  </ul>
  
  <p>The last criteria is that if the cells in column "A" equal to "BLANK" was preceded by a zero value in the previous cell than those "BLANK" would also equal to a "void" value in the output column "B" :</p>
  
  <p>So if Column "A" had this scenario:</p>
  
  <ul>
  <li>0</li>
  <li>BLANK</li>
  <li>BLANK</li>
  </ul>
  
  <p>Output Column "B" needs to be:</p>
  
  <ul>
  <li>void</li>
  <li>void</li>
  <li>void</li>
  </ul>
  
  <p>I'm unsure of how to apply the Continue For since I want the loop to "skip" over the "BLANK" cells for the next iteration, but still fill the corresponding value into the "B" column with the subsequent qualifying value.  I would prefer to complete this via vba, because once again I am trying to learn the language so I am forcing myself to increase my exposure to it.</p>
  
  <p>Once again any assistance on the matter would be highly appreciated.  </p>
  
  <p>Thank you!</p>