VBA Get Data Multiple files - from same folder as VBA file

Mave

New Member
Joined
Feb 28, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Im a rookie when it comes to VBA, but I am trying to help my colleagues out by consolidating data from multiple files at once.

Background story: For each single day we create an order sheet in excel. At the end of the month, we need to consolidate that month's data.
I have found several example codes, yet in each one I found I need to specify the path of the folder.

Is it possible in VBA to take the path where the file is located? For example I will create a new workbook called Order Sheet Summary, paste it into the January folder, run VBA to collect all data in all the excel files in there.
To make it easy for my colleagues, I would like to copy paste the same file to February, and run it, etc. without having to change the path.

Hope it is possible, looking forward to your answers and potential (alternative) solutions!

Best regards,
Mave
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hi all,

I think I have found it, by using "ThisWorkbook.Path"!
So this will allow my colleagues to copy&paste this file into the folder they need, and consolidate the data from all the files in there.

Best regards,
Mave
 
Upvote 0

Forum statistics

Threads
1,215,014
Messages
6,122,697
Members
449,092
Latest member
snoom82

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top