如何合并几个excel的教程
时间:2022-08-31 19:11:45
在Excel中录入好数据以后经常需要用到合并几个Excel的功能,如果还有朋友不会合并几个Excel的功能不妨学习一番。接下来是小编为大家带来的如何合并几个excel的教程,供大家参考。
如何合并几个excel的教程:
合并几个Excel步骤1:新建一个文件夹
合并几个Excel步骤2:将要合并的表格放到里面
合并几个Excel步骤3:新建一个表格
合并几个Excel步骤4:用excel打开
合并几个Excel步骤5:右击Sheet1
合并几个Excel步骤6:选择查看代码
PS:excel有着一项,WPS没有
合并几个Excel步骤7:将下列代码复制到文本框中:
Sub 合并当前目录下所有工作簿的全部工作表()
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 & "个工作薄下的全部工作表。如下:" & Chr(13) & WbN, vbInformation, "提示"
End Sub
合并几个Excel步骤8:点击运行
合并几个Excel步骤9:一段时间(取决于表格的大小和多少)后,合并完成了
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
excel表格任务栏怎么设置
word怎么设置正文页码从1开始?
![](https://img.aspxhome.com/file/2023/8/29008_0s.jpg)
Excel条件格式公式应用四例
![](https://img.aspxhome.com/file/2023/8/38538_0s.jpg)
Word2016文档中如何使用草稿视图
在word中怎么制作图片水印
excel表格如何插入斜线表头
word文档怎么取消打字自动换行
![](https://img.aspxhome.com/file/2023/4/31704_0s.png)
如何在Word里插入数学公式你用对了吗?Word添加公式可以这么做
![](https://img.aspxhome.com/file/2023/0/33360_0s.jpg)
在Word2007中设置SmartArt图形位置
![](https://img.aspxhome.com/file/2023/1/20551_0s.jpg)
Excel表格怎么设置公式进行求和
2021.01.01微软商店将不再提供Office Lens,抓紧下载备用
![](https://img.aspxhome.com/file/2023/1/16871_0s.jpg)
Win10怎么关闭笔记本触摸板?
![](https://img.aspxhome.com/file/2023/0/49370_0s.png)
如何在word2007添加和插入目录
![](https://img.aspxhome.com/file/2023/2/29362_0s.jpg)
Word2013将文档转存为PDF阅读格式
![](https://img.aspxhome.com/file/2023/2/21202_0s.jpg)
怎么免费激活最新的office 2021.8最新office2016/2019激活密钥分享
![](https://img.aspxhome.com/file/2023/2/14932_0s.jpg)
word怎么设置项目编号左侧编号数字为上标?
![](https://img.aspxhome.com/file/2023/3/22613_0s.png)
word 文档中人民币符号¥怎么输入?
![](https://img.aspxhome.com/file/2023/4/35674_0s.jpg)
此时我们要选择列内排序
Excel怎么一次性批量删除表格中的图片
![](https://img.aspxhome.com/file/2023/3/40133_0s.jpg)
word中如何把行间距调小点?
![](https://img.aspxhome.com/file/2023/5/18425_0s.png)