Merging Identically formatted excel workbooks with multiple sheets

stucklikechuck

New Member
Joined
Jan 16, 2015
Messages
2
Sounds pretty basic, I've got multiple identical workbooks with a number of identically formatted (header rows & sheet names) sheets in each workbook. All workbooks are in one directory and i cant seem to consolidate all the data from each sheet within each workbook to a master workbook. I just want the data, nothing to complicated. I've scoured this forum for an hour and half and everything recommended seems a little scenario specific for me to understand what the codes doing. Tried many recommendations to no avail. I'm close with

Code:
Sub GetSheets()
Path = "C:\Users\Manda Banxx\Desktop\Nut Facts\all\"
Filename = Dir(Path & "*.xls")
Do While Filename <> ""
Workbooks.Open Filename:=Path & Filename, ReadOnly:=True
For Each Sheet In ActiveWorkbook.Sheets
Sheet.Copy After:=ThisWorkbook.Sheets(1)
Next Sheet
Workbooks(Filename).Close
Filename = Dir()
Loop
End Sub

but i get a compiler error about cant assign to read only property. Tried False to no avail and none of the workbooks are read only. I also clicked a few ads. :)
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,216,028
Messages
6,128,395
Members
449,446
Latest member
CodeCybear

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