Split Data Into Multiple Worksheets By Rows Count excel

The following VBA code can help you split the rows into multiple worksheets by rows count, do as follows:

1. Hold down the ALT + F11 key to open the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

Split data into sheets by rows count in Excel.

Sub SplitData()
Dim WorkRng As Range
Dim xRow As Range
Dim SplitRow As Integer
Dim xWs As Worksheet
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
SplitRow = Application.InputBox("Split Row Num", xTitleId, 5, Type:=1)
Set xWs = WorkRng.Parent
Set xRow = WorkRng.Rows(1)
Application.ScreenUpdating = False
For i = 1 To WorkRng.Rows.Count Step SplitRow
    resizeCount = SplitRow
    If (WorkRng.Rows.Count - xRow.Row + 1) < SplitRow Then resizeCount = WorkRng.Rows.Count - xRow.Row + 1
    Application.Worksheets.Add after:=Application.Worksheets(Application.Worksheets.Count)
    Set xRow = xRow.Offset(SplitRow)
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub

3. Then press F5 key to run the code, and a dialog pops out for selecting a range to split, and then click OK, and another dialog for you to specify the rows count.

4. Click OK, and the range are split into multiple sheets by the rows count.