Excel表如何拆分成多个表,每个表3000数据

 

按住alt依次按f11,i,m.
粘贴下面代码后按f5,会在该目录下得到拆分后的文件.


Sub test()
Application.ScreenUpdating = False
p = ThisWorkbook.Path & "\"
With ActiveSheet
For r = 1 To .Range("a1048576").End(xlUp).Row Step 3000
Set wb = Workbooks.Add
.Rows(r).Resize(3000).Copy wb.Sheets(1).Cells(1)
wb.SaveAs p & r & ".xls", xlNormal
wb.Close
Next
End With
Application.ScreenUpdating = True
End Sub

Excel表如何拆分成多个表,每个表3000数据_第1张图片

你可能感兴趣的:(其他)