Importing excel files...Please Help!

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

Guest

Hello

I would like to know if there is a way to import an exel file specifying to
import from the fifth row (heading row) downwards.

I am working in Access 2002, and have a macro that automatically imports an
Excel spreadsheet into the database. Unfortunately, the spreadsheet has 4
rows at the top (which cannot be deleted - long story!), and then the 5th row
contains the field headings, and the data resides below that.

Is there a way that I can specify in my macro, to import the data from the
spreadsheet from the heading row (always row 5) downwards?

Hoping someone can help
Thanking you in advance

AC
 
AFAIK, you can't do it with the Import Wizard. but if you can identify
something that is common to a specific cell (called a field in Access) in
the first 4 rows (called records in Access), but not a part of the rest of
the rows, then you should be able to set a Validation Rule on that field in
your Access table, to exclude that common element. then, when you import the
Excel file, those records will fail the validation and not be imported.

hth
 
You're going to need to use Automation. There are a lot of good examples
posted on the web. I recently poosted and article at DBJ that might help.

http://www.databasejournal.com/features/msaccess/article.php/3557541

One of the first lines of code sets the "start row"

' Sometimes there is header info, so the "Start Row" isn't the first one.
' Set this variable to the first row that contains actual data.
intStartRow = 2

Get the download and step through the code. It is verbose, but not difficult
once you play with it a little.
 
Back
Top