|
楼主 |
发表于 2024-7-30 09:39
|
显示全部楼层
本帖最后由 13602822168 于 2024-7-30 09:57 编辑
附件中已有代码,如何插入条件?具体怎么改?可以直接替代原先在L列的数值吗?谢谢
原先的代码:
Sub L到U计算() '第1-1组
Application.DisplayAlerts = False
Application.DisplayAlerts = False
Dim i, n, m, arr, brr, crr, drr, a
arr = Range("D1:J" & [ACU65536].End(3).Row)
brr = [M4:T4]
crr = Range("L16:U" & [ACU65536].End(3).Row)
For i = 16 To UBound(arr)
For j = 1 To UBound(arr, 2)
If arr(i, j) = brr(1, 1) Then
m = m + 1
crr(i - 15, m) = arr(1, j)
End If
Next
m = 0
Next
[L16].Resize(UBound(crr), UBound(crr, 2)) = crr
End Sub
|
|