Copy multiple sheets data with format to another workbook

arijitirf

Board Regular
Joined
Aug 11, 2016
Messages
108
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

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
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
Thank you so much. Works fine and this is what I actually need.
 
Upvote 0

Forum statistics

Threads
1,215,429
Messages
6,124,840
Members
449,193
Latest member
MikeVol

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