A
asxastro
Is this possible in MS Access VBA.
In MS Access have a table which contains 4 columns.
Column 1 contains records relating to the path of MS Excel File.
E.g. c:\\my_file\MS Excel\workbook1.xls
Column 2 contains records relating to the workbook name.
E.g. Sheet1
Column 3 contains records relating the one 'Column' letter in the
above MS excel workbook.
E.g. F
Column 4 contains records relating the another 'Column' letter in the
above MS excel workbook.
E.g. AB
A records layout will look like this in MS Access:
Path |
Worksheet_Name | Column1 | Column2
---------------------------------------------------------------------------------------------------------------------------------
c:\\my_file\MS Excel\workbook1.xls | Sheet1
| F | AB
c:\\my_file\MS Excel\workbook2.xls | Sheet23
| H | Z
My main question is : Can one build a macro which will go through the
above table records.
1st: Identify if path is valid.
2nd: Open the read only MS workbook.
3rd: Identify if worksheet is valid.
4th: Go to the specified Worksheet.
5th: Identify if column1 is unhidden.
6th: Copy the record contents in Column1
7th: Paste in a MS Access table call 'tbl_Holding' in column name
"Column1_Rlts".
8th: Identify if column1 is unhidden.
9th: Copy the record contents in Column2
10th: Paste in a MS Access table call 'tbl_Holding' in column name
"Column2_Rlts".
11th Remove blank records from the 'tbl_Holding' table in MS Access.
12th: Closed the MS workbook.
13th Loop points 1- 11 again until all records have gone through in
the table.
Final table would look like this:
Path |
Worksheet_Name | Column1_Rlts | Column2_Rlts
------------------------------------------------------------------------------------------------------------------------------------------------
c:\\my_file\MS Excel\workbook1.xls | Sheet1
| AAAAA | BBBB16
c:\\my_file\MS Excel\workbook1.xls | Sheet1
| ATAAD | BBBB12
c:\\my_file\MS Excel\workbook1.xls | Sheet1
| ASAAD | BBBV12
c:\\my_file\MS Excel\workbook2.xls | Sheet23
| DDDDA | ZSSSSS
c:\\my_file\MS Excel\workbook2.xls | Sheet23
| DDDDA | ZSSSSS
c:\\my_file\MS Excel\workbook2.xls | Sheet23
| DDDDA | ZSSSSS
......................
Many thanks in advance.... Apreciate any tip or links to help me with
this quest.
Kind regards.
In MS Access have a table which contains 4 columns.
Column 1 contains records relating to the path of MS Excel File.
E.g. c:\\my_file\MS Excel\workbook1.xls
Column 2 contains records relating to the workbook name.
E.g. Sheet1
Column 3 contains records relating the one 'Column' letter in the
above MS excel workbook.
E.g. F
Column 4 contains records relating the another 'Column' letter in the
above MS excel workbook.
E.g. AB
A records layout will look like this in MS Access:
Path |
Worksheet_Name | Column1 | Column2
---------------------------------------------------------------------------------------------------------------------------------
c:\\my_file\MS Excel\workbook1.xls | Sheet1
| F | AB
c:\\my_file\MS Excel\workbook2.xls | Sheet23
| H | Z
My main question is : Can one build a macro which will go through the
above table records.
1st: Identify if path is valid.
2nd: Open the read only MS workbook.
3rd: Identify if worksheet is valid.
4th: Go to the specified Worksheet.
5th: Identify if column1 is unhidden.
6th: Copy the record contents in Column1
7th: Paste in a MS Access table call 'tbl_Holding' in column name
"Column1_Rlts".
8th: Identify if column1 is unhidden.
9th: Copy the record contents in Column2
10th: Paste in a MS Access table call 'tbl_Holding' in column name
"Column2_Rlts".
11th Remove blank records from the 'tbl_Holding' table in MS Access.
12th: Closed the MS workbook.
13th Loop points 1- 11 again until all records have gone through in
the table.
Final table would look like this:
Path |
Worksheet_Name | Column1_Rlts | Column2_Rlts
------------------------------------------------------------------------------------------------------------------------------------------------
c:\\my_file\MS Excel\workbook1.xls | Sheet1
| AAAAA | BBBB16
c:\\my_file\MS Excel\workbook1.xls | Sheet1
| ATAAD | BBBB12
c:\\my_file\MS Excel\workbook1.xls | Sheet1
| ASAAD | BBBV12
c:\\my_file\MS Excel\workbook2.xls | Sheet23
| DDDDA | ZSSSSS
c:\\my_file\MS Excel\workbook2.xls | Sheet23
| DDDDA | ZSSSSS
c:\\my_file\MS Excel\workbook2.xls | Sheet23
| DDDDA | ZSSSSS
......................
Many thanks in advance.... Apreciate any tip or links to help me with
this quest.
Kind regards.