|
本帖最后由 半百 于 2023-1-16 13:25 编辑
不知道理解的对不对
Sub TEST()
Set D = CreateObject("scripting.dictionary")
ARR = Sheets("对账单").UsedRange
For I = 2 To UBound(ARR) - 1
S = ARR(I, 7) & "," & ARR(I, 13) & "," & Format(ARR(I, 14), "M")
D(S) = D(S) + ARR(I, 17)
Next
A = D.KEYS
For I = 0 To UBound(A)
B = Split(A(I), ",")
R = I * 10 + 11
With Sheets("开票信息")
.Rows("1:7").Copy .Cells(R, 1)
.Cells(R, 1) = "22." & B(2) & "月运费开票金额(含税)"
.Cells(R, 3) = D(A(I))
.Cells(R + 3, 3) = B(0)
.Cells(R + 5, 3) = B(1)
.Cells(R + 6, 3) = "商品车2022年" & B(2) & "月运费比亚迪"
End With
Next
End Sub
|
|