Copying sheets from multiple workbooks into a master workbook

cw1

New Member
Joined
Mar 25, 2010
Messages
10
HI Guys i'm hoping one of you will be able to help me with the macro i'm trying to create as I have no idea what I am doing!

I have multiple workbooks all contained in one folder which all have a sheet titled "Summary".
I have another workbook which I would like to pull all the "summary" sheets into (if possible values and format) and change the name of the sheet to the contents of one of the cells in the sheet plus the word summary eg cell B2 = Widget therefore sheet name should be "WidgetSummary" So I will end up with the master file which already has 2 sheets in it plus a number of summary sheets all pulled from different workbooks which are stored in 1 folder.

I hope that makes sense, any help would be really appreciated.
 
The only circumstance in which the sheet isn't renamed is if that name isn't valid (ie an error is generated). Of course there could be a number of reasons for that, including duplicate names. If you want to see what is causing the error comment out:

On Error Resume Next
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi Andrew,

I'm not quite sure how I see what is causing the error (I am very new to this). But looking at it it seems to be the files with longer names which are not working, is this likely to be the issue? Going completely off topic would you suggest getting a book and trying to self teach VB or would you suggest finding a course instead?

Thanks again for all your help!
 
Upvote 0
Hi Andrew,

I've renamed the files and it all works now, thank you very much for your help quite clearly I couldn't have got it working without you!

I will have a look at that book you recommend as I would be very interesting to learn some VB.

Thanks Again!
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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