title: Generating a list of dates given the start and end dates
body: <p>Previously I found some VBA code done by Andy Brown that generates a list and makes each date the first or 15th for another user. I have tried to adjust this code to my needs but I'm struggling. Currently the code, once run, is just putting in the same date over and over and I have to end Excel.</p>
  
  <pre><code>Sub GenerateDates()
  
  Dim FirstDate As Date
  Dim LastDate As Date
  Dim NextDate As Date
  
  FirstDate = Range("A1").Value
  LastDate = Range("a2").Value
  
  NextDate = FirstDate
  Range("B1").Select
  
  Do Until NextDate &gt;= LastDate
  
      ActiveCell.Value = NextDate
      ActiveCell.Offset(1, 0).Select
  
      If Day(NextDate) = 1 Then
          NextDate = DateAdd("d", NextDate, 14)
      Else
          NextDate = DateAdd("d", NextDate, 20)
          NextDate = DateSerial(Year(NextDate), Month(NextDate), 1)
      End If
  
  Loop
  </code></pre>
  
  <p>Previous code I based my model upon is listed above and my, most likely terrible code, is below:</p>
  
  <pre><code>Sub GenerateDates()
  
  Dim FirstDate As Date
  Dim LastDate As Date
  Dim NextDate As Date
  
  FirstDate = Range("startdate").Value
  LastDate = Range("enddate").Value
  
  NextDate = FirstDate
  Range("tripdays").Select
  'selection of columns within one row
  Do Until NextDate &gt;= LastDate
  
      ActiveCell.Value = NextDate
      ActiveCell.Offset(1, 0).Select
  
      If Day(NextDate) = 1 Then
          NextDate = DateAdd("d", NextDate, 14)
  
      End If
  
  Loop
  
  End Sub
  </code></pre>
  
  <p>What I need instead is to generate <strong><em>every</em></strong> date between the given start and end dates, instead of just the 15th and 1st. How is this done?</p>