[Solved] Import Specific Cells from variable sheets into Access Tables.
Hello Once again, I am trying to get an import system running in the backend database to import results into the appropiate tables. Some parts work quite well where the format of the spreadsheet (or CSV) is that of headers and so forth, but there are a few reports which tend to be somewhat of a pain to import.
I have spreadsheets supplied in format PG*.xls, and to make life a little bit more difficuilt they are not really normalised (except that the results are always in the same cells) and the headers and so on change a little. In addition in the one spreadsheet there are variable sheets with different names. Every sheet needs to be imported but to be honest i am not sure where to start with VBA allowing me to import into the access tables, but then also how to parse through the names of the sheets to get all of the data out when the names are not fixed or known.
Is anyone able to offer some help with this one, i have listed below some of the cells of interest from the workbook, the aim is to eventually get it to parse through a directory looking for any PG*.cls files and import them, then to move them to an "Imported" folder so they are not duplicated.
Thanks!
TBL_ESDAT_SAMPLES
SAMPLE_CODE = C16
LOC_CODE = C6
LABNAME = "SGS"
TBL_ESDAT_CHEMISTRY
SAMPLE_CODE = C16
ORIGINAL_CHEM_NAME = B22
RESULTVALUE = C22
COMMENTS = B25
VISIBLE = "1"
Hello Once again, I am trying to get an import system running in the backend database to import results into the appropiate tables. Some parts work quite well where the format of the spreadsheet (or CSV) is that of headers and so forth, but there are a few reports which tend to be somewhat of a pain to import.
I have spreadsheets supplied in format PG*.xls, and to make life a little bit more difficuilt they are not really normalised (except that the results are always in the same cells) and the headers and so on change a little. In addition in the one spreadsheet there are variable sheets with different names. Every sheet needs to be imported but to be honest i am not sure where to start with VBA allowing me to import into the access tables, but then also how to parse through the names of the sheets to get all of the data out when the names are not fixed or known.
Is anyone able to offer some help with this one, i have listed below some of the cells of interest from the workbook, the aim is to eventually get it to parse through a directory looking for any PG*.cls files and import them, then to move them to an "Imported" folder so they are not duplicated.
Thanks!
TBL_ESDAT_SAMPLES
SAMPLE_CODE = C16
LOC_CODE = C6
LABNAME = "SGS"
TBL_ESDAT_CHEMISTRY
SAMPLE_CODE = C16
ORIGINAL_CHEM_NAME = B22
RESULTVALUE = C22
COMMENTS = B25
VISIBLE = "1"
Last edited: