title: How can I loop the date into this sql table using Excel VBA
body: <p>I have a 4 column table which is currently setup with the following columns:</p>
  
  <p>Insurer/Underwriter,
  Agent,
  Day,
  Budgeted_Amount,</p>
  
  <p>The Insurer/Underwriter will have 12 entries of the same insurer but they will be assigned to a different month and a have a different budget amount </p>
  
  <p>The insurer/underwriter, agent columns and budgeted amount run from row 78 to row 375. There is one entry for the insurer and agent but then there are 12 monthly columns for the budgeted amount</p>
  
  <p>On row 77 there are the 12 months of the year, what I need is a loop of some sort that will place the date in the relevant entry </p>
  
  <p>This is my current code, which is populating the insurer, agent and months - it does this by repeating the row range 11 times to give a full years worth of entries but the dates aren't showing up </p>
  
  <p>StartColumn = 26,</p>
  
  <p>MaxColumn = 37</p>
  
  <pre><code>For CurrentColumn = StartColumn To MaxColumn
  
  StartRow = 78
  EndRow = 375
  For CurrentRow = StartRow To EndRow
  
  
  
      Insurer_Underwriter = Sheet8.Cells(CurrentRow, 2)
      Agent = Sheet8.Cells(CurrentRow, 3)
      Day = Sheet8.Cells(CurrentRow)
      Day = Format(Day, "dd-MM-YYYY")
      Budgeted_Amount = Sheet8.Cells(CurrentRow, CurrentColumn + 10)
  
  
  
  
  
      sSQL = "INSERT INTO [C3 Forecast].Budget_Data_Dan VALUES ('" &amp; Insurer_Underwriter &amp; _
      "','" &amp; Agent &amp; "','" &amp; Day &amp; "','" &amp; Budgeted_Amount &amp; "')"
      Cn.Execute sSQL
  </code></pre>
  
  <p>Please could someone point out where to place the loop to pick up the dates on Row 77, columns 36 to 47.</p>
  
  <p>Thanks
  Dan</p>