|
楼主 |
发表于 2014-9-29 16:07
|
显示全部楼层
cf7315752 发表于 2014-9-29 13:16
http://club.excelhome.net/forum. ... 9&page=1#pid7873812
我在这个帖子给你回复了 你可以看看 不懂或 ...
我看到了,首先非常感谢你先!但下面那些Sub 汇总()
ActSheet_name = ActiveSheet.Name
Condition = Sheets(ActSheet_name).Cells(1, 2)
Sheets(ActSheet_name).Cells(2, 2) = 0
usemax = Sheets(ActSheet_name).UsedRange.Rows.Count
Rows("10:" & usemax + 1).Clear
For Each sht In Sheets
If sht.Name <> ActSheet_name Then
hmax = sht.UsedRange.Rows.Count
usemax = Sheets(ActSheet_name).UsedRange.Rows.Count
For i = 1 To hmax
If sht.Cells(i, 1) = Condition Then
Sheets(ActSheet_name).Cells(2, 2) = Sheets(ActSheet_name).Cells(2, 2) + sht.Cells(i, 2)
Set rng = sht.Cells(i, 1).Resize(1, sht.UsedRange.Columns.Count)
End If
Next
rng.Copy Sheets(ActSheet_name).Range("A" & usemax + 1)
Set rng = Nothing
End If
Next
End Sub
我看不懂,是公式来的吗 |
|