Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2007
    Location
    Stalybridge, Manchester
    Posts
    273

    Unanswered: Import Excel Spreadsheet Ranges into a table

    Hi, I am trying to import a series of Ranges from a spreadsheet into different tables within access. I have written some code that would import a worksheet into a table but I want to adapt it so that it will pick up the different ranges and import to relevant tables.

    I have 5 ranges that need to be imported to 5 tables.

    Private Sub cmdImport_Click()
    strPath = "\\titan\home\jeremyl1\"
    strFileName = Dir(strPath & "5HG_Feb_Comm.xls")
    MsgBox "Data Loading...", vbInformation, "Jez"
    If Len(strFileName) <> 0 Then
    DoCmd.TransferSpreadsheet acImport, , strTempTable, strPath &
    strFileName, True
    End If
    MsgBox "Import Complete", vbInformation, "Jez"
    End Sub

    Thanks,
    Jez

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I think we've had this conversation before: http://www.dbforums.com/showthread.php?t=1617496

    There's nothing wrong with bumping your original thread, in fact, it's better than creating a new one - so all the answers are contained in one place
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •