I have 100 worksheets within one workbook (A). I would like to copy worksheets that contain more than 35 rows of data into workbook (B).
The code I wrote copies worksheets that have less than 35 rows of data.
Sub Split_workbook()
Dim last_row as long
Dim sh as worksheet
For Each sh In Worksheets
last_row = cells(rows.count,"A").End(xlUp).Row
If last_row >= 35 Then
sh.Copy after:=workbooks("B.xlsx").Sheets(Workbooks("B.xlsx").Sheets.count)
End if
Workbooks("A.xlsx").activate
Next sh
End Sub