title: Excel VBA DO loop to scan range of dates and fill in missing dates
body: <p>I have a worksheet that has ~20,000 rows of data.  Each row has a Transaction Date in Column C.  Each worksheet will only include data from the previous month.  What I am trying to have happen, is to have a loop run through each date and make sure there are no missing dates, if there is a missing date, I need the loop to insert the missing date into a new row.  I have found this online and  have tried to customize it to my worksheet but cannot get it to work:</p>
  
  <pre><code> Dim i As Long:  i = 1
   'Adds missing dates as new rows
   Do
   If Cells(i + 1, "C") &gt; Cells(i, "C") + 1 Then
        Rows(i + 1).Insert xlShiftDown
        Cells(i + 1, "C") = Cells(i, "C") + 1
   End If
   i = i + 1
   Loop Until Cells(i + 1, "C") = ""
  </code></pre>
  
  <p>I have a bunch of different macros that format the data into a table and then sort it by the transaction date.  I'm not sure if the table creates another issue or not but I can't seem to get it to work.  </p>
  
  <p>Any tips are greatly appreciated!</p>