Results 1 to 7 of 7
  1. #1
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672

    Manipulate Excel Data

    I am attempting to import an excel spreadsheet into access 2013. The issue that I have is that the column that I need to import varies, meaning it is never the same, whether it be A, B, C, D etc. What I was thinking was, let's set the search text then scan the Excel file, locate the text in the header row, then scan that row to locate the last row. Lastly, use that syntax to import that column to the last row into the database.

    Meaning -> let's say that the data exists in column B and the last row is 1123 then I would want to import like such:
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tbltempDass", MypathDass, True, "B1: B1123"



    And of course the range (the last data range) would be variables....Just do not know how to code it in Access VBA

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You don't need to set the range while importing. Bring in all the data and do the manipulating in Access.

  3. #3
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    Quote Originally Posted by aytee111 View Post
    You don't need to set the range while importing. Bring in all the data and do the manipulating in Access.
    Import the entire spreadsheet and manipulate it in access? Meaning just run delete queries to remove the uneeded columns/rows?

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You would import it into a temporary table and append the data to an already designed table. If the columns in Excel are truly empty then only one column will be imported.

  5. #5
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    Once I import the data into a temp table in access how do I know which column of the temp table to append to the prod table? W/O eyeballing it? I was wanting to do this through VBA with no manual intervention

  6. #6
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Like I said, if only one column contains data then only one column will be imported. Otherwise, if the columns contain extra blank characters you could write a routine to read each column that has been imported to see if it contains valid data. First, ascertain whether this is necessary tho.

  7. #7
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    Excellent, thank you!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 05-13-2016, 10:37 AM
  2. manipulate excel iconset
    By xopherira in forum Forms
    Replies: 1
    Last Post: 02-13-2016, 10:03 AM
  3. Manipulate Forms
    By Milade8080 in forum Forms
    Replies: 6
    Last Post: 07-14-2014, 12:51 PM
  4. 2-questions regarding data manipulate date:
    By djclntn in forum Queries
    Replies: 6
    Last Post: 08-12-2012, 12:29 PM
  5. Manipulate DB through VB ...
    By Zoroxeus in forum Programming
    Replies: 2
    Last Post: 12-18-2005, 01:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums