用excel VBA怎么把多个工作表里的数据复制到一个工作表里

如题所述

Sub hebing()
Dim sht As Worksheet, a As Integer, b As Integer, rng As Range
For Each sht In Worksheets
If sht.Name <> ActiveSheet.Name Then
Set rng = Range("a" & 2^20).End(xlup).Offset(1, 0)
a = sht.Range("a1").CurrentRegion.Rows.Count
b = sht.Range("a1").CurrentRegion.Columns.Count
sht.Range("a2").Resize(a - 1, b).Copy rng
End If
Next
End Sub
温馨提示:答案为网友推荐,仅供参考
相似回答