Very complicated, copy and paste sheets in a loop

ss6857

New Member
Joined
Jan 17, 2011
Messages
27
Hello everyone. I run a report where there is a summary report and then a report for individuals. WHen the report is ran, it adds sheets to the active workbook and the sheets are called the persons name. So by the end of the report I have a sheet for (for example):

Smith, Joe
Johnson, Sue
Wagner, Henry
Armstrong, Jerry
Summary

I would then like to extract the individual's sheet along with the summary and save it in a new workbook then save it. So I would have four workbooks including:

Smith, Joe and Summary
Johnson, Sue and Summary
Wagner, Henry and Summary
Armstrong, Jerry and Summary

However I am having a hard time extracting the individual sheet. To name the sheets, a range in a control sheet has the list of names and it loops to each name. I would like to use that same range and loop through to identify the name of the sheet and extract it.

Code:
originalBook = ThisWorkbook.Name
    
    Set vRegRg = Sheets("Library").Range("B2").End(xlDown)
        For Each vRegRg In Sheets("Library").Range("B2:B15")
            Workbooks.Add
            Workbooks(originalBook).Sheets("Summary").Copy Before:=ActiveWorkbook.Sheets(1)
            Workbooks(originalBook).Sheets("vRegRg").Copy Before:=ActiveWorkbook.Sheets(2)
                  
Next

I appreciate any and all help. Thank you.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,224,522
Messages
6,179,292
Members
452,902
Latest member
Knuddeluff

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