title: How to fix this code? It writes to file the first argument, why not the second?
body: <p>I am working on this code to automate "copy-paste" by reading from an access table and write to excel sheet. 
  Different values from access table, needs to be written in a particular cells on excel sheet.
  My problem is that the code works by reading and writing the first value, but not the second++ values.</p>
  
  <p>The first value is correctly written on E15 in Excel, but the second value which is supposed to be written on cell E16 is not written, Why?</p>
  
  <pre><code>Sub HentData()
  
  Dim cn As Object, rs As Object
  Dim intColIndex As Integer
  Dim DBFullName As String
  Dim TargetRange As Range
  Dim Sum As Double
  
  DBFullName = "C:\saga_effekt_Nidaros_2017_tiltak.mdb"
  
  Application.ScreenUpdating = False
  
  Set TargetRange = Sheets("1.3 Persontransportmodell").Range("A1")
  
  Set cn = CreateObject("ADODB.Connection")
  
  cn.Open "DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\saga_effekt_Nidaros_2017_tiltak.mdb;"
  
  Set rs = CreateObject("ADODB.Recordset")
  
  rs.Open "SELECT [VERDI] FROM [saga_trafikantnytte] WHERE [REISEMIDDE] = 'tog' AND [VARIABEL] = 'sum'", cn, , , adCmdText
  
  For intColIndex = 0 To rs.Fields.Count - 1
      'TargetRange.Offset(1, intColIndex).Value = rs.Fields(intColIndex).Name
      Next
  
  TargetRange.Offset(14, 4).CopyFromRecordset rs
  
   Application.ScreenUpdating = True
  
      On Error Resume Next
      rs.Close
      Set rs = Nothing
      cn.Close
      Set cn = Nothing
      On Error GoTo 0
      Exit Sub
  
  rs.Open "SELECT [VERDI] FROM [saga_trafikantnytte] WHERE [REISEMIDDE] = 'tog' AND [VARIABEL] = 'referansetrafikk'", cn, , , adCmdText
  
  For intColIndex = 0 To rs.Fields.Count - 1
      'TargetRange.Offset(1, intColIndex).Value = rs.Fields(intColIndex).Name
      Next
  
  TargetRange.Offset(15, 4).CopyFromRecordset rs
  
   Application.ScreenUpdating = True
  
      On Error Resume Next
      rs.Close
      Set rs = Nothing
      cn.Close
      Set cn = Nothing
      On Error GoTo 0
      Exit Sub
  
  End Sub
  </code></pre>
  
  <p>I dont get any error messages, the code runs, but the output is not complete.</p>