我的一个EXCEL表格中有100个工作表,怎样把这个表格分割成每5个工作表为1个表格?
如题。求VBA脚本。谢谢! --------------------编程问答-------------------- 同问一下 --------------------编程问答-------------------- 录制宏有效么 --------------------编程问答-------------------- 写个循环就行了,不是说你上来就给个语句你的,你自己总要学习的 --------------------编程问答-------------------- Private Sub mergesheets()Dim i%, j%, r%
Application.DisplayAlerts = False
For i = 1 To 96 Step 5
For j = i + 1 To i + 4
r = Sheets(i).UsedRange.Rows.Count + 1
Sheets(i).Cells(r, 1) = Sheets(j).UsedRange
Next
Next
For i = 96 To 1 Step -5
For j = i + 4 To i + 1 Step -1
Sheets(j).Delete
Next
Next
Application.DisplayAlerts = True
End Sub
希望对你有用 --------------------编程问答--------------------
Sub test()--------------------编程问答--------------------
On Error GoTo err
Dim wb As Workbook
Set wb = Workbooks("Book1.xls")
MsgBox "文件已打开"
Exit Sub
err: MsgBox "文件未打开"
End Sub
学习,这个代码不错!
补充:VB , VBA