|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub 计算数据()
Range("b2:bzt105").Replace What:=",", Replacement:=","
arr = Range("b2:b105")
brr = Range("d2:bzt105")
m = UBound(arr)
n = UBound(brr, 2)
ReDim brr2(1 To m, 1 To n)
For i = 1 To m
a = Split(arr(i, 1), ",")
For j = 1 To n
If i = 1 Then
brr2(i, j) = 0
Else
brr2(i, j) = brr2(i - 1, j)
End If
For k = 0 To UBound(a)
If InStr(brr(i, j), a(k)) Then
If i = 1 Then
brr2(i, j) = 1
Else
brr2(i, j) = brr2(i - 1, j) + 1
End If
End If
Next
Next
Next
[d107].Resize(m, n) = brr2
End Sub
试一试。 |
评分
-
2
查看全部评分
-
|