vba to extract data from multiple excel files in 1 folder

Peter083

Board Regular
Joined
Feb 26, 2011
Messages
53
Hi, can someone please help me with the following. I have a number of excel workbooks in a folder. I am trying to extract the data from Sheet 4 (10 rows maximum) in each of these files into a separate workbook. Ideally the macro will only look at workbooks that are in this folder.

Any help or suggestions would be greatly appreciated.

Peter
 
Ensure the line is at the very top of the code window before any subs are written
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
I assumed it was this line that was causing you issues

Code:
[COLOR=#333333]Private Const sPath As String = "C:\Users\naveed\Downloads\Buzzme-Reports-2" 'CHANGE THIS TO YOUR DIRECTORY PATH[/COLOR]

This line must be at the very top of the code window.
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,305
Members
452,633
Latest member
DougMo

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