|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
代码如下。。。
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Address = "$H$1" Then
arr = [b3:b34]
ReDim brr(1 To UBound(arr) - 9, 1 To 1)
m = 0
For i = 10 To UBound(arr)
If arr(i, 1) <> 0 Then
n = 0
For j = i - 10 + 1 To i
If arr(j, 1) <> 0 Then n = n + 1
Next
m = m + 1
brr(m, 1) = n
Else
m = m + 1
brr(m, 1) = "#N/A"
End If
Next
[h12].Resize(UBound(brr)) = brr
End If
Application.EnableEvents = True
End Sub
|
评分
-
2
查看全部评分
-
|