title: Export Specific Cells From Excel To MS Access
body: <p>The code below (given to me) works but I don’t understand  the Values (line line 9). I keep getting error messages when I try to add more cells. Im new to VBA could someone add more fields so I can better understand, such as: </p>
  
  <p>C5 into Ingredient2
  C6 into Ingredient3
  C7 into Ingredient4
  L5 into Lot2
  L6 into Lot3
  L7 into Lot4 
  and a whole bunch more.</p>
  
  <p>The values below are arbitrary just for testing. Please tack a look at my spreadsheet
  The spreadsheet I am using is here: <a href="https://mega.co.nz/#!2cZ3kKAZ!BL-HJM...1tZewrw-CH-1Dc" rel="nofollow">https://mega.co.nz/#!2cZ3kKAZ!BL-HJM...1tZewrw-CH-1Dc</a></p>
  
  <pre><code>Sub Button10_Click()
    Dim strSQL As String
  
    Set appAccess = CreateObject("Access.Application")
  
    appAccess.Visible = False
  
    strSQL = "INSERT INTO [Finished Batches] ([Production Date],[Lot_Number],[Ingredient1],[Amount1]) " &amp; _
             "VALUES (#" &amp; Range("C5") &amp; "#,'" &amp; Range("D5") &amp; "','" &amp; Range("F23") &amp; _
             "'," &amp; Range("G23") &amp; ")"
  
    With appAccess
      .OpenCurrentDatabase ("C:\users\jay neuh\desktop\database\ss database.mdb")
      .DoCmd.RunSQL strSQL, dbFailOnError
      .CloseCurrentDatabase
    End With
  
    Set appAccess = Nothing
  End Sub
  </code></pre>
  
  <p>Thanks for any help</p>