|
本帖最后由 cmo9020 于 2022-11-20 09:23 编辑
各位导师周末好~假日愉快
统計笔数到Sheet2
代码需要如何修改?请导师看是否有空帮忙修改一下
谢谢各位大神导师们帮忙~谢谢
Sub awtest()
Dim Arr, i As Long, j As Long
Application.ScreenUpdating = False
Application.DisplayStatusBar = False
With Sheets("Sheet2")
.Range("B1:Y2").ClearContents
.Range("b26").Value = " "
Arr = .UsedRange.Value
For i = 4 To UBound(Arr)
For j = 2 To UBound(Arr, 2)
Arr(2, j) = Arr(2, j) + Val(Arr(i, j))
Next
For j = 13 To UBound(Arr, 2)
If VBA.IsDate(Arr(3, j)) Then Arr(1, j) = "W" & Format(Arr(3, j), "ww")
Next
Next
.UsedRange.Value = Arr
Application.DisplayStatusBar = True
Application.ScreenUpdating = True
End With
ThisWorkbook.Save
End Sub
|
|