Asked by Wass_QA
at 2024-07-17 17:29:45
Point:400 Replies:9 POST_ID:829012USER_ID:11914
Topic:
Microsoft Excel Spreadsheet Software;;
Hello,
Can you please help.
I'm trying to find a macro that would:
I have about 25 - 50 Excel Workbooks (same folder) that I need to merge into one workbook,
but, I need each Workbooks to be on a separate tab.
Workbooks 1
Workbooks 2
Workbooks 3....
so, I should have 25 tabs to 50 tabs. (Workbooks 1,Workbooks 2,Workbooks 3,...)
Any help is appreciated.
thanks
Can you please help.
I'm trying to find a macro that would:
I have about 25 - 50 Excel Workbooks (same folder) that I need to merge into one workbook,
but, I need each Workbooks to be on a separate tab.
Workbooks 1
Workbooks 2
Workbooks 3....
so, I should have 25 tabs to 50 tabs. (Workbooks 1,Workbooks 2,Workbooks 3,...)
Any help is appreciated.
thanks
Accepted Solution
Expert: Glenn Ray replied at 2024-07-18 09:13:34
400 points EXCELLENT
Do you need to include comma-delimited (CSV) files along with Excel (xls) files? It would require an additional process.
If you want CSV files instead of XLS files, this code would work:
If you want CSV files instead of XLS files, this code would work:
I've updated the example workbook with this second macro (and button).
-Glenn
Author: Wass_QA replied at 2024-07-18 08:33:37
thank you very much Glen,
this worked,
how do I add .csv file formats?
thanks
this worked,
how do I add .csv file formats?
thanks
Expert: Glenn Ray replied at 2024-07-18 08:06:41
The following code should do what you request:
It does not check for filename length, nor does it check for any duplicate filenames (possible if you have different Excel versions with the same name: ex., "File1.xls", "File1.xlsx", "File1.xlsm"). However, it should work given your described environment.
Also, it only copies the first sheet of any workbook. The assumption is that each of the workbooks are single-sheet workbooks and that the resulting sheet tab names will be renamed to the workbook filename.
I've attached a macro-enabled file for your use.
Regards,
-Glenn