如何合并幾個(gè)excel的教程
如何合并幾個(gè)excel的教程
在Excel中錄入好數(shù)據(jù)以后經(jīng)常需要用到合并幾個(gè)Excel的功能,如果還有朋友不會(huì)合并幾個(gè)Excel的功能不妨學(xué)習(xí)一番。接下來(lái)是學(xué)習(xí)啦小編為大家?guī)?lái)的如何合并幾個(gè)excel的教程,供大家參考。
如何合并幾個(gè)excel的教程:
合并幾個(gè)Excel步驟1:新建一個(gè)文件夾
合并幾個(gè)Excel步驟2:將要合并的表格放到里面
合并幾個(gè)Excel步驟3:新建一個(gè)表格
合并幾個(gè)Excel步驟4:用excel打開(kāi)
合并幾個(gè)Excel步驟5:右擊Sheet1
合并幾個(gè)Excel步驟6:選擇查看代碼
PS:excel有著一項(xiàng),WPS沒(méi)有
合并幾個(gè)Excel步驟7:將下列代碼復(fù)制到文本框中:
Sub 合并當(dāng)前目錄下所有工作簿的全部工作表()
Dim MyPath, MyName, AWbName
Dim Wb As workbook, WbN As String
Dim G As Long
Dim Num As Long
Dim BOX As String
Application.ScreenUpdating = False
MyPath = ActiveWorkbook.Path
MyName = Dir(MyPath & "\" & "*.xls")
AWbName = ActiveWorkbook.Name
Num = 0
Do While MyName <> ""
If MyName <> AWbName Then
Set Wb = Workbooks.Open(MyPath & "\" & MyName)
Num = Num + 1
With Workbooks(1).ActiveSheet
.Cells(.Range("B65536").End(xlUp).Row + 2, 1) = Left(MyName, Len(MyName) - 4)
For G = 1 To Sheets.Count
Wb.Sheets(G).UsedRange.Copy .Cells(.Range("B65536").End(xlUp).Row + 1, 1)
Next
WbN = WbN & Chr(13) & Wb.Name
Wb.Close False
End With
End If
MyName = Dir
Loop
Range("B1").Select
Application.ScreenUpdating = True
MsgBox "共合并了" & Num & "個(gè)工作薄下的全部工作表。如下:" & Chr(13) & WbN, vbInformation, "提示"
End Sub
合并幾個(gè)Excel步驟8:點(diǎn)擊運(yùn)行
合并幾個(gè)Excel步驟9:一段時(shí)間(取決于表格的大小和多少)后,合并完成了