CutAndPaste
Registered User.
- Local time
- Today, 17:33
- Joined
- Jul 16, 2001
- Messages
- 60
I've got to import a great many Worksheets into a database. Each has 2 worksheets
Worksheet1 has the company information but this is laid out in 2 Columns:
Column1 Column2
CompanyName: Smiggins Mouldings
Address1: Brick Lane
Worksheet2 has the Product Information data laid out the "proper" way with a row of column headings for field names and then a row of data.
The data in the workbooks are defined as ranges "CompanyInfo" and "ProductInfo". When I use the transferspreadsheet method, Access imports the ProductInfo range fine but wants to treat the CompanyInfo range as several records each with one value whereas in the real world it is only one record with lots of fields.
As I see it, one solution would be:
1) Create some vba to open each Workbook, Insert a New Worksheet, Copy Cell A1 to A1, A2 to B1, A3 to C1 etc. to get the data in a row & then close, save, & move onto the next workbook.
Then I can use another routine to import the transposed company info range on the new worksheet into the mdb.
I can do the range import fine, but the Open, create new worksheet, copy / transpose data & save are beyond me.
How can I get around this?
tx
Worksheet1 has the company information but this is laid out in 2 Columns:
Column1 Column2
CompanyName: Smiggins Mouldings
Address1: Brick Lane
Worksheet2 has the Product Information data laid out the "proper" way with a row of column headings for field names and then a row of data.
The data in the workbooks are defined as ranges "CompanyInfo" and "ProductInfo". When I use the transferspreadsheet method, Access imports the ProductInfo range fine but wants to treat the CompanyInfo range as several records each with one value whereas in the real world it is only one record with lots of fields.
As I see it, one solution would be:
1) Create some vba to open each Workbook, Insert a New Worksheet, Copy Cell A1 to A1, A2 to B1, A3 to C1 etc. to get the data in a row & then close, save, & move onto the next workbook.
Then I can use another routine to import the transposed company info range on the new worksheet into the mdb.
I can do the range import fine, but the Open, create new worksheet, copy / transpose data & save are beyond me.
How can I get around this?
tx
Last edited: