'合并多个相同格式的worksheet数据到一个worksheet
Sub hebing()
Rows("2:1024576").Clear
Dim sht As Worksheet, xrow As Integer, rng As Range
For Each sht In Worksheets
If sht.Name <> ActiveSheet.Name Then
Set rng = Range("A1024576").End(xlUp).Offset(1, 0) '获得A列第一个空单元格
xrow = sht.Range("A1").CurrentRegion.Rows.Count - 1 '获得各分表中记录的条数
sht.Range("A2").Resize(xrow, 4).Copy rng '复制记录到汇总表,4代表列数
End If
Next
End Sub