JohanGduToit
Board Regular
- Joined
- Nov 12, 2021
- Messages
- 89
- Office Version
- 365
- 2016
- Platform
- Windows
Greetings Forum,
I receive Excel Files containing customer sales information on a weekly basis which I have to import into MS Access. I have to reformat them prior to importing. Each file consists of four worksheets and each worksheet contain the same number of columns (A to X) (each worksheet has various row counts).
I need to consolidate the four worksheets into one 'Consolidated' worksheet within the same Excel file.
Before consolidating the four worksheets, the following must happen on each of these sheets:
(a) Rows 1 to 3 must be deleted
(b) Columns on each of the worksheets run from "A" to "X"; but I am only interested in consolidating (copying) columns A, B, C, D, H and N (all the other columns may be ignored).
Once consolidated, the four original worksheets should be deleted so that only the 'Consolidated' worksheet remain (without any column headers).
The VBA procedure will reside within my MS Access application and will be called using the command : Call FormatMrPSport(fName) where fName will be the name of the Excel File to be processed.
Any help to assist me with some sample code would be greatly appreciated. My current code is designed to use late binding and what I have successfully deletes top 3 rows and deletion of columns; but failing on the consolidation part.
Many thanks!!
I receive Excel Files containing customer sales information on a weekly basis which I have to import into MS Access. I have to reformat them prior to importing. Each file consists of four worksheets and each worksheet contain the same number of columns (A to X) (each worksheet has various row counts).
I need to consolidate the four worksheets into one 'Consolidated' worksheet within the same Excel file.
Before consolidating the four worksheets, the following must happen on each of these sheets:
(a) Rows 1 to 3 must be deleted
(b) Columns on each of the worksheets run from "A" to "X"; but I am only interested in consolidating (copying) columns A, B, C, D, H and N (all the other columns may be ignored).
Once consolidated, the four original worksheets should be deleted so that only the 'Consolidated' worksheet remain (without any column headers).
The VBA procedure will reside within my MS Access application and will be called using the command : Call FormatMrPSport(fName) where fName will be the name of the Excel File to be processed.
Any help to assist me with some sample code would be greatly appreciated. My current code is designed to use late binding and what I have successfully deletes top 3 rows and deletion of columns; but failing on the consolidation part.
Many thanks!!