title: Bubble Sort in VBA isn't sorting correctly
body: <p>I am trying to bubble sort some data and it the sorting isn't working. I think I have to be doing something obviously silly. I have followed the code close enough to know it is something wrong with the actually sorting alg.</p>
  <pre><code>        Do While Low &lt;= High And Worksheets(&quot;Data&quot;).Cells(i, Column_EAM_WorkOrderNum) &lt;&gt; &quot;&quot;
              CheckVal = (High + Low) / 2
              If Worksheets(&quot;Data&quot;).Cells(i, Column_EAM_WorkOrderNum) = Worksheets(&quot;Data2&quot;).Cells(CheckVal, Column_KSR_WorkOrderNum) Then
                 'Copy Data Over
                  Worksheets(&quot;Data&quot;).Range(&quot;AM1&quot;).Offset(i - 1, 0).Value = Worksheets(&quot;Data2&quot;).Range(&quot;A1&quot;).Offset(CheckVal - 1, Column_KSR_ServiceID - 1).Value
                  Worksheets(&quot;Data&quot;).Range(&quot;AN1&quot;).Offset(i - 1, 0).Value = Worksheets(&quot;Data2&quot;).Range(&quot;A1&quot;).Offset(CheckVal - 1, Column_KSR_CreatedDate - 1).Value
  '
                  If IsNumeric(Column_KSR_Type) = True Then
                      Worksheets(&quot;Data&quot;).Range(&quot;AO1&quot;).Offset(i - 1, 0).Value = Worksheets(&quot;Data2&quot;).Range(&quot;A1&quot;).Offset(CheckVal - 1, Column_KSR_Type - 1).Value
                  End If
                  Exit Do
              ElseIf Worksheets(&quot;Data&quot;).Cells(i, Column_EAM_WorkOrderNum) &lt; Worksheets(&quot;Data2&quot;).Cells(CheckVal, Column_KSR_WorkOrderNum) And Worksheets(&quot;Data2&quot;).Cells(CheckVal, Column_KSR_WorkOrderNum) &lt;&gt; &quot;Service Provider Ref #&quot; Then
                  Low = CheckVal - 1
              Else
                  High = CheckVal + 1
              End If
          Loop
  </code></pre>
  <p>I apologize in advance: Do to how this code is setup I couldn't figure out an easy way to provide the minimal reproduceable code without copying in hundreds of lines of code to support this one simple block. I'm hoping I'm just missing something obvious.</p>