Add opened worksheets into a summary workbook

hi77l

New Member
Joined
Aug 16, 2009
Messages
1
Hi!

I am new to using VB in excel and I need some help. I am doing a program where in I need to open several files in a folder then add those opened sheets in a file, this file contains 1 sheet which will summarize all the data in the opened worksheets. I have a sample code but this code will create new file not add the opened files into a summary file.
sample code:
Dim newWB As Workbook, aWB As Workbook
Set newWB = Workbooks.Add
For Each aWB In Application.Workbooks
If aWB Is newWB Or aWB Is ThisWorkbook Then
Else
aWB.Sheet(1).Move after:=newWB.Sheet(1)
End If
Next aWB

Hope you could help me. Thanks

Hi77l:confused:
 
Last edited:

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,215,837
Messages
6,127,185
Members
449,368
Latest member
JayHo

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