How to Combine Multiple Excel Files using VBA

Published: 09 September 2022
on channel: Excel Macro Mastery
34k
786

Ready to master VBA?
- Check out my full courses:
- Subscribe to the channel here:
-Want to download the source code for this video? Go here:
(Note: If the download page doesn't work then make sure to turn off any popup blockers)

How to Combine Multiple Excel Files using VBA

In this video I show 3 examples of reading muliple Excel workbooks to one worksheet. The examples are:
1. Copy all the data.
2. Copy specific columns.
3. Return to the total amount for each item of the 3 files.




RELATED RESOURCES:
(Blog Post)Excel VBA Copy – The Complete Guide to Copying Data:
(Blog Post)Excel VBA Array – The Complete Guide:
(Blog Post)Excel VBA Dictionary - A Complete Guide


YouTube PlayList: Excel VBA Dictionary:

Useful VBA Shortcut Keys
========================

Debugging:
Compile the code: Alt + D + L OR Alt + D + Enter
Run the code from the current sub: F5
Step into the code line by line: F8
Add a breakpoint to pause the code: F9(or click left margin)

Windows:
View the Immediate Window: Ctrl + G
View the Watch Window: Alt + V + H
View the Properties Window: F4
Switch between Excel and the VBA Editor: Alt + F11
View the Project Explorer Window: Ctrl + R

Writing Code:
Search keyword under cursor: Ctrl + F3
Search the word last searched for: F3
Auto complete word: Ctrl + Space
Get the definition of the item under the cursor: Shift + F2
Go to the last cursor position: Ctrl + Shift + F2
Get the current region on a worksheet: Ctrl + Shift + 8(or Ctrl + *)
To move lines of code to the right(Indent): Tab
To move lines of code to the left(Outdent): Shift + Tab
Delete a Line: Ctrl + Y(note: this clears the clipboard)

Table of Contents:

00:00 - Introduction
01:11 - Code - return all the data
05:05 - Using Dir to get the files
06:12 - Reading the workbook data
08:18 - Writing the data to the worksheet
12:07 - IndividualColumns
14:20 - Totalling Values


Watch video How to Combine Multiple Excel Files using VBA online without registration, duration 19 minute 06 second in high hd quality. This video was added by user Excel Macro Mastery 09 September 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 34 thousand once and liked it 78 people.