一、按住 ALT + F11 键打开 Microsoft Visual Basic应用程序 窗口。
二、点击 插页 > 模块,然后将以下代码粘贴到 模块 窗口。
Sub CombineSheet1()
Dim i, k, j, n As Integer
n = 1
For i = 6 To ThisWorkbook.Sheets.Count
For k = 1 To 60
For j = 1 To 8
ThisWorkbook.Sheets(4).Cells(n, j).Value = ThisWorkbook.Sheets(i).Cells(k, j).Value
#纵向罗列 在工作表4纵向复制粘贴从I表开始的Cell(行,列)
Next j
n = n + 1
Next k
Next i
End Sub
#以下是横向罗列,举一反三
Sub CombineSheet2()
Dim i, k, j, n As Integer
n = 1
For i = 5 To ThisWorkbook.Sheets.Count
For k = 1 To 8
For j = 1 To 60
ThisWorkbook.Sheets(4).Cells(j, n).Value = ThisWorkbook.Sheets(i).Cells(j, k).Value
Next j
n = n + 1
Next k
Next i
End Sub
三、按住 ALT + F8,快捷唤出模块。
真棒,感谢分享!