Copy multiple sheets data with format to another workbook

arijitirf

Board Regular
Joined
Aug 11, 2016
Messages
118
Office Version
  1. 2016
Platform
  1. Windows
I am trying to copy first 200 sheets with same format to another workbook with each of the copied worksheet to have their own tab with the same sheet name.

I am not expert in VBA so I have tired many vba script found using google but can't figure it out.

In my excel there are about 1200 sheets from which I want to make 6 different workbook using 200 sheets for each workbook. Now for the first workbook I need to copy first 200 sheets and paste it a workbook with same format and sheets name. In same manner the second workbook will be created from next 200 sheets and go on.

Help required.

Thanks in advance.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
How about
Code:
Sub copyShts()
   Dim ary() As Variant
   Dim i As Long, j As Long
   For i = 0 To ThisWorkbook.Sheets.Count - 1 Step 200
      For j = 1 To 200
         ReDim Preserve ary(1 To j)
         ary(j) = ThisWorkbook.Sheets(i + j).Name
      Next j
      ThisWorkbook.Sheets(ary).Copy
      ReDim ary(1 To 1)
   Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,249
Members
452,623
Latest member
Techenthusiast

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