excel中如何合並多個sheet到一個表?


轉自老外的帖子,試過了管用:https://www.extendoffice.com/documents/excel/1184-excel-merge-multiple-worksheets-into-one.html

excel中打開宏編輯器,粘貼如下宏代碼:

Sub Combine()
Dim As Integer
On Error Resume Next
Sheets(1). Select
Worksheets.Add
Sheets(1).Name =  "Combined"
Sheets(2).Activate
Range( "A1" ).EntireRow. Select
Selection.Copy Destination:=Sheets(1).Range( "A1" )
For J = 2  To Sheets.Count
Sheets(J).Activate
Range( "A1" ). Select
Selection.CurrentRegion. Select
Selection.Offset(1, 0).Resize(Selection.Rows.Count - 1). Select
Selection.Copy Destination:=Sheets(1).Range( "A65536" ). End (xlUp)(2)
Next
End Sub
 
運行宏


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM