title: VBA Excel: How to loop through Column B for cells containing alphanumeric or just numeric content?
body: <p>I have data in column B that I need to loop through and then copy the corresponding value in column D for each row, to another sheet in the same workbook.
  I need a code written to search through every value in Column B, return the corresponding value in Column D for the same row, and then find the next numbers in order from the given range(in this case I have set it from 7 to 10).</p>
  
  <p>So loop through Column B, find values 7, 7a, 8, 9, 10 in that order (even if a larger value is located before a lower value as you go down), and copy the corresponding values in Column D to another sheet.
  Excel Data Chart in Sheet3 (Column A is not needed):</p>
  
  <p>A    B   C    D        E</p>
  
  <pre><code>1   1a  78.15   77.68      This is row 7
  1a  2   77.18   76.92
  2   3   76.92   76.63
  3   4   76.13   75.78
  4   4a  75.78   75.21
  4a  5   75.11   74.87
  5   5a  74.87   74.69
  5a  6   73.94   73.6
  6   6a  73.1    72.71
  6a  6b  72.41   72.18
  6b  10  72.18   71.6
  10  11  71.3    70.89
  11  12  70.89   69.83
  12  13  69.83   68.68
  13  14  68.68   67.68
  14  15  67.63   66.46
  15  16  66.01   64.84
  16  16a 64.24   63.72
  16a 16b 56.82   56.37
  16b 16c 56.37   55.18
  16c OUT 47.28   47.27
  7   7a  83.12   76.07
  7a  8   76.17   75.99
  8   9   74.79   74.41
  9   6   74.51   74        This is row 31
  </code></pre>
  
  <p>My problem: When the code encounters a cell containing letters AND numbers, it skips that cell and moves to the next cell in that range containing only numbers. How do I edit/re-write the code to INCLUDE alphanumeric values in the search criteria?</p>
  
  <p>Here is my code that loops through column B but excludes cells with letters and numbers: </p>
  
  <pre><code>Sub EditBEST()
  
  Dim Startval As Long
  Dim Endval As Long          'Finds values corresponding
                              'to input in B and C
  Dim LastRow As Long
  
  
  
  LastRow = Sheets("Sheet3").range("B" &amp; Rows.Count).End(xlUp).Row
  Startval = Worksheets("Sheet3").Cells(1, "O").Value
  Endval = Worksheets("Sheet3").Cells(1, "P").Value
  
  
  StartRow = 2                                            'row that first value will be pasted in
  
  
  
  For x = 7 To LastRow                                         'decides range to search thru in "Sheet3"
  
     If Sheets("Sheet3").Cells(x, 2).Value &gt;= 7 And Sheets("Sheet3").Cells(x, 2).Value &lt;= 10 Then               'if cell is not blank
          Sheets("Sheet4").Cells(StartRow, 2).Value = _
                   Sheets("Sheet3").Cells(x, 4).Value             'copy/select cell value in D
           StartRow = StartRow + 1                                      'cell.Offset(0, 1).Value =
          End If
          If Sheets("Sheet3").Cells(x, 3) &gt;= 7 And Sheets("Sheet3").Cells(x, 3).Offset(0, 1) &lt;= 10 Then
              Sheets("Sheet4").Cells(StartRow, 2).Value = _
                  Sheets("Sheet3").Cells(x, 5).Value
          StartRow = StartRow + 1
          End If
  
  Next x
  
  
  End Sub  
  </code></pre>
  
  <p>Thank you</p>