Determining excel range

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to import excel worksheet data into an ms access table. My problem is
that I will never be able to determine the range of data I need in the
worksheet. using the docmd.transferspreadsheet function does not work very
well due to the condition of the worksheet. The top 15 rows of the worksheet
are header related information and totally distort the import.

My question is...using ADO and excel automation, If i know the first row and
field the data starts and the columns it resides in, is there a way to
determine the range (end of) rows containing data? This will vary from time
to time. If I can determine this, I will be able to read the data into a
recordset.

Once Again...thanks in advance
 
If there's nothing else in the way, then you could just make sure that the
range you choose to import is larger than the actual range. So if you have
a little batch of data starting in E5 then...

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "test", _
"filename", False, "e5:z100"

....just picks out the data without all of the additional space.
 

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

Back
Top