VBA Code to Copy Data from Multiple Files in a Folder and Copy to 1 Sheet

tiredtea

New Member
Joined
May 7, 2020
Messages
2
Office Version
  1. 2010
Platform
  1. Windows
Hello Mr. Excel gang,

I have spent 10 hours trying and trying my hand at this code. It seems like a repetitive question after scouring the web yet any code I came across gave me some kind of issue, even with hours of tinkering. That being said - SOS

>I have hundreds of files in a folder on my X drive
>They all only have one sheet, titled "Incident Report"
>They have a various number of lines, all typically maxing out at line 10,027.
>Each workbooks' data starts at line A28.
>Each column has data to column AA (last column with data. Column AB and onwards is empty)

I just want to copy all of this data into my original open sheet (Sheet1) without any line gaps in the data.

As an aside, these files all downloaded as as an Excel HTTP Page? So every time you try to open one of the files, you get the error that I have attached below. But if you click "Yes", it opens as expected. Is that an underlying issue?
 

Attachments

  • 2Error.PNG
    2Error.PNG
    59.5 KB · Views: 15

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,224,828
Messages
6,181,213
Members
453,024
Latest member
Wingit77

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