TransferSpreadsheet / Specific Columns

V

Vel

I need to design a module to import specific columns of data from a
spreadsheet. The spreadsheet is generated by an agency my company contracts
with and contains several columns of data which are irrelevant for our use.
Is there a way to specify specific columns of data in the "range" argument of
the TransferSpreadsheet method?

I know I could just alter the spreadsheet, or create named ranges, but this
is an inelegant solution, and may cause some confusion considering the
technical expertise of my userbase. I need to be able to just have them
download the excel report (which will be different each week) then click a
button in my database. I'm very familiar with VBA code, but I'm not sure how
to reference specific columns in Excel for the data import.
 
J

Jerry Whittle

I suggest importing the entire spreadsheet into a temporary table within the
database. Then use update/append queries based on the temp table to populate
other tables as required. Then truncate or delete all the records out of the
temp table if necessary.
 
D

Dirk Goldgar

Jerry Whittle said:
I suggest importing the entire spreadsheet into a temporary table within
the
database.

Or link to it, and execute append queries that draw data from the desired
columns in the linked table.
 
V

Vel

Thanks,

Its funny how sometimes the most obvious and simple answer can be overlooked
when trying out something new (like using the TransferSpreadsheet method for
the first time). I have to run various queries on the data once its imported
anyway before it reaches its final state and makes it into the permanent
table. I can just ignore those fields which I don't need.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top