工作薄分解合并成工作表(The workbook decomposes and combines into worksheets).docVIP

  • 9
  • 0
  • 约7.2千字
  • 约 13页
  • 2017-10-06 发布于河南
  • 举报

工作薄分解合并成工作表(The workbook decomposes and combines into worksheets).doc

工作薄分解合并成工作表(The workbook decomposes and combines into worksheets)

工作薄分解合并成工作表(The workbook decomposes and combines into worksheets) How does excel combine multiple worksheets in a workbook into a worksheet? Open your workbook to a new worksheet in the sheet tab on the right to view the code you copy the following code to it, then there is a subroutine can run, code is as follows, if there is a problem, you can try tools macro macro security to the lower or low again try Sub merges all worksheets under the current workbook () Application.ScreenUpdating = False For J = 1, To, Sheets.Count If Sheets (J) ActiveSheet.Name Then.Name X = Range (A65536),.End (xlUp),.Row + 1 Sheets (J).UsedRange.Copy Cells (X, 1) End If Next Range (B1).Select Application.ScreenUpdating = True MsgBox all worksheets under the current workbook have been merged! VbInformation, hint End Sub Break the worksheet into a workbook 1, open excel, press alt+F11 to enter the programming mode 2. Select the bottom ThisWorkbook of the list on the left 3, appear code box, copy the code closed. Sub, SaveSheet () For, Each, WS, In, ThisWorkbook.Worksheets Ws.Copy ActiveWorkbook.SaveAs Filename:= _ ThisWorkbook.Path \ ws.Name, FileFormat:=xlNormal _ Password:=, WriteResPassword:=, ReadOnlyRecommended:=False, _ CreateBackup:=False ActiveWorkbook.Close Next End Sub 4. click on the running command of the status bar! A plurality of thin work into a job execution module in using. To build a macro in the macro code. MyPath = ActiveWorkbook.Path ActiveName = ActiveWorkbook.Name MyName = Dir (MyPath \ *.xls) I = 0 Do While MyName If MyName ActiveName Then Set Wb = Workbooks.Open (MyPath \ MyName] I = I + 1 With Workbooks (1).ActiveSheet For J = 1, To, Sheets.Count Wb.Sheets (J),.Copy, Before:=Workbooks (ActiveName),.Sheets (1) Next Wbn = Wbn Chr (13) Wb.Name Wb.Close False End With End If MyName = Dir Loop MsgBox merged together I Workbook, as follows: Chr (13) Wbn, Workbook merge In one step, the worksheet in several industrial thin sheets is merged into a worksheet in a

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档