On Error Resume Next '主要过滤掉值为0的情况
T = Sheets(1).UsedRange.Rows.Count
arr1 = Sheets(1).Range("a1:m" & T)
Dim arr2
ReDim arr2(1 To T - 1, 1 To 15)
For n = 1 To UBound(arr2)
For i = 1 To 13
arr2(n, i) = (arr1(n + 1, i) - arr1(n, i)) / arr1(n, i)
Next
Next
Sheets(2).[a1:m1].Resize(UBound(arr2)) = arr2
TT = Sheets(2).UsedRange.Rows.Count
For i = 1 To TT
Sheets(2).Range("o" & i) = Abs(Application.WorksheetFunction.Sum(Sheets(2).Range("a" & i & ":m" & i)))
TTT = Sheets(3).UsedRange.Rows.Count
If Sheets(2).Range("o" & i) < 0.3 Then
Sheets(3).Range("a" & TTT + 1 & ":m" & TTT + 1) = Sheets(1).Range("a" & TTT + 1 & ":m" & TTT + 1)
Sheets(3).Range("a" & TTT + 2 & ":o" & TTT + 2) = Sheets(2).Range("a" & TTT + 2 & ":o" & TTT + 2)
End If
Next
End Sub
我的回答 被百度 坑了
=COUNTIF(OFFSET($A$1,MATCH("座",A:A)-4,,),"*提取*") *COUNTIF(OFFSET($A$1,MATCH("座",A:A)-3,,),"*【*"&B7&"*】*")-COUNTIF(OFFSET($A$1,MATCH("座",A:A)-4,,),"*提取*") *COUNTIF(OFFSET($A$1,MATCH("座",A:A)-3,,),"*】*"&B7&"*【*")
Sub 按钮1_Click()Dim arr(1 To 10)
On Error Resume Next
For d = 1 To 10
arr(d) = 0
Next
r = Range("B3").End(xlDown).Row
c = Range("B3").End(xlToRight).Column
f1 = [p1]
f2 = [p2]
For i = 2 To c
For j = 3 To r - 1
If Cells(j, i) = f1 And Cells(j + 1, i) = f2 Then
arr(Cells(j - 1, i)) = arr(Cells(j - 1, i)) + 1
arr(Cells(j + 2, i)) = arr(Cells(j + 2, i)) + 1
End If
Next
Next
[T3].Resize(10, 1) = Application.Transpose(arr)
End Sub
[T3] 可以改成 S3 ,我做测试 用的 T3
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)