Hi,
I have a spreadsheet which I've imported into one table, 'Assets', in Access. In the table, I have to separate the data based on one attribute: 'empID'. empID is the employee ID and can occur in multiple rows, so it's not the primary key.
What I need to do is this:
1. go through the entire Assets table and produce a spreadsheet for each empID. So for each unique empID, a spreadsheet will be made containing all the data related in that record. If an empID has more than one entry in the table, it will be included on a new line in the spreadsheet.
ex.
Assets
empID --- country --- name
eR123 --- Canada --- Jason
eN432 --- China --- Clifford
eR123 --- Canada --- Jason
eU543 --- Mexico --- Alex
This would give 3 new spreadsheets names eR123.xls with 2 rows, eN432.xls and eU543.xls both with 1 row each.
2. These speadsheets have to be named based on their empID. So all spreadsheet for empID 'eR123' would be named 'eR123.xls'. I have a template spreadsheet that can be used, but I'm not sure how to name them dynamically using VB or macros. I have several thousand records to process so doing this manually isn't an option.
Any help or direction would be very much appreciated!!
Thanks,
Jason
I have a spreadsheet which I've imported into one table, 'Assets', in Access. In the table, I have to separate the data based on one attribute: 'empID'. empID is the employee ID and can occur in multiple rows, so it's not the primary key.
What I need to do is this:
1. go through the entire Assets table and produce a spreadsheet for each empID. So for each unique empID, a spreadsheet will be made containing all the data related in that record. If an empID has more than one entry in the table, it will be included on a new line in the spreadsheet.
ex.
Assets
empID --- country --- name
eR123 --- Canada --- Jason
eN432 --- China --- Clifford
eR123 --- Canada --- Jason
eU543 --- Mexico --- Alex
This would give 3 new spreadsheets names eR123.xls with 2 rows, eN432.xls and eU543.xls both with 1 row each.
2. These speadsheets have to be named based on their empID. So all spreadsheet for empID 'eR123' would be named 'eR123.xls'. I have a template spreadsheet that can be used, but I'm not sure how to name them dynamically using VB or macros. I have several thousand records to process so doing this manually isn't an option.
Any help or direction would be very much appreciated!!
Thanks,
Jason
Comment