肉机机:Sub shishi()
Set sh1 = Sheet1
最大列 = sh1.Cells(1, Columns.Count).End(xlToLeft).Column
Set 工作簿 = Workbooks.Open("E:\文档\test.xlsx")
For i = 1 To 最大列
表头 = sh1.Cells(1, i)
Debug.Print 表头
For Each sh In 工作簿.Sheets
表名 = sh.Name
Debug.Print 表名
Set Rng = sh.Cells.Find(表头, lookat:=xlWhole)
If Not Rng Is Nothing Then
表头最大行 = sh.Cells(Rows.Count, Rng.Column).End(xlUp).Row
最大行2 = sh1.Cells(Rows.Count, i).End(xlUp).Row + 1
sh.Range(Rng.Offset(1, 0), sh.Cells(表头最大行, Rng.Column)).Copy sh1.Cells(最大行2, i)
End If
Next sh
Next i
工作簿.Close
End Sub