Sub test()
Dim lastRow As Long, myRow As Long, myBook As Workbook
lastRow = ThisWorkbook.Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
For myRow = 2 To lastRow Step 900
Set myBook = Workbooks.Add
ThisWorkbook.Sheets("Sheet1").Rows(myRow & ":" & myRow + 899).EntireRow.Copy myBook.Sheets("Sheet1").Range("A1")
Next myRow
End Sub
Sub test()
Dim lastRow As Long, myRow As Long, mySheet As Worksheet
lastRow = ThisWorkbook.Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
For myRow = 2 To lastRow Step 900
Set mySheet = Worksheets.Add
Sheets("Sheet1").Rows(myRow & ":" & myRow + 899).EntireRow.Copy mySheet.Range("A1")
Next myRow
End Sub
Sub CopyTable()
'Set dimensions
Dim Table As Range, TableArray(), _
CutValue As Integer, Cntr As Integer, _
TempArray(), Width As Integer, _
x As Integer, y As Integer, _
Height As Long, Rep As Integer, _
LoopReps As Long
'Get data
Set Table = Application.InputBox("Specify range to copy", _
Default:=ActiveCell.CurrentRegion.Address, Type:=8)
CutValue = InputBox("How many rows should the chunks be?", _
Default:=900)
Width = Table.Columns.Count
Height = Table.Rows.Count
'Write to array
TableArray = Table
ReDim TempArray(1 To CutValue, 1 To Width)
Rep = Application.WorksheetFunction.RoundUp(Height / CutValue, 0)
LoopReps = CutValue
'Loop through all new sheets
For Cntr = 0 To Rep - 1
If Height - Cntr * CutValue < CutValue Then _
LoopReps = Height - Cntr * CutValue
For x = 1 To Width
For y = 1 To LoopReps
TempArray(y, x) = TableArray(y + Cntr * CutValue, x)
Next y
Next x
Worksheets.Add
Range("A1").Resize(LoopReps, Width) = TempArray
Next Cntr
End Sub
Here is my version:
Code:Sub CopyTable() 'Set dimensions Dim Table As Range, TableArray(), _ CutValue As Integer, Cntr As Integer, _ TempArray(), Width As Integer, _ x As Integer, y As Integer, _ Height As Long, Rep As Integer, _ LoopReps As Long 'Get data Set Table = Application.InputBox("Specify range to copy", _ Default:=ActiveCell.CurrentRegion.Address, Type:=8) CutValue = InputBox("How many rows should the chunks be?", _ Default:=900) Width = Table.Columns.Count Height = Table.Rows.Count 'Write to array TableArray = Table ReDim TempArray(1 To CutValue, 1 To Width) Rep = Application.WorksheetFunction.RoundUp(Height / CutValue, 0) LoopReps = CutValue 'Loop through all new sheets For Cntr = 0 To Rep - 1 If Height - Cntr * CutValue < CutValue Then _ LoopReps = Height - Cntr * CutValue For x = 1 To Width For y = 1 To LoopReps TempArray(y, x) = TableArray(y + Cntr * CutValue, x) Next y Next x Worksheets.Add Range("A1").Resize(LoopReps, Width) = TempArray Next Cntr End Sub