Macros for moving data to Access from Excel

K

ktoth04

Hi, I was wondering if someone could help me... I need to create a macro or
VB script that selects certain rows from a range of rows in Excel (if not
empty), and then Creates a new entry in Access, and pastes data in line by
line, until all the data is copied.

I receive several of these worksheets a week, so I need to be sure the
script copies to the end of the DB every time, and doesn't override any
previously entered data.

Thanks!
 
J

John W. Vinson

Hi, I was wondering if someone could help me... I need to create a macro or
VB script that selects certain rows from a range of rows in Excel (if not
empty), and then Creates a new entry in Access, and pastes data in line by
line, until all the data is copied.

I receive several of these worksheets a week, so I need to be sure the
script copies to the end of the DB every time, and doesn't override any
previously entered data.

Thanks!

Take a look at the VBA help for the "TransferSpreadsheet" method.

I'd suggest using TransferSpreadsheet (or, equivalently, using File... Get
External Data... Link) to link to the spreadsheet, and then run an Append
query to append the data into your existing table. Copy and paste is NOT
necessary or appropriate.
 
Top