|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
代码如下。。。
Private Sub 汇总刷新_Click()
Application.ScreenUpdating = False
Dim sht As Worksheet
Set sh = ThisWorkbook.Sheets("汇总")
arr = Intersect(sh.Columns("j:k"), sh.UsedRange)
ReDim brr(1 To 10000, 1 To 6)
For Each sht In ThisWorkbook.Worksheets
If sht.Name <> "汇总" Then
s = Application.VLookup(sht.Name, arr, 2, 0)
If Not IsError(s) Then
n = n + 1
brr(n, 1) = n
brr(n, 2) = sht.Name
brr(n, 3) = s
brr(n, 6) = sht.[b19]
End If
End If
Next
With sh
.[a3:h32,f33].ClearContents
.[a3].Resize(n, 6) = brr
For i = 1 To n
Sum = Sum + Val(brr(i, 6))
Next
.[f33] = Sum
End With
Beep
Application.ScreenUpdating = True
End Sub
|
|