'
'Set D = Nothing
'Set D = CreateObject("SCRIPTING.DICTIONARY")
'For i = 1 To UBound(Arr)
' TT = Arr(i, 交貨日期欄C)
' D(TT) = ""
'Next
'交貨日 = Application.Transpose(D.KEYS) '請教前輩 日期陣列要怎麼排序??
'ReDim KLrr(1 To D.Count, 1 To 2)
'For x = 2 To UBound(Arr)
' Cdr = Arr(x, 交貨日期欄C)
' For i = 2 To D.Count
' Jdr = 交貨日(i, 1)
' If Cdr = Jdr Then
' KLrr(i, 1) = KLrr(i, 1) + 1
' KLrr(i, 2) = KLrr(i, 2) + Arr(x, SAP_PO欄M)
' Exit For
' End If
' Next
'Next
Set D = Nothing
Set D = CreateObject("SCRIPTING.DICTIONARY")
For i = 2 To UBound(Arr)
Cdr = Arr(i, 交貨日期欄C)
If Not D.Exists(Cdr) Then
D(Cdr) = D.Count + 1
End If
Next
交貨日 = Application.Transpose(D.KEYS) '請教前輩 日期陣列要怎麼排序??
ReDim KLrr(1 To D.Count, 1 To 2)
For x = 2 To UBound(Arr)
Cdr = Arr(x, 交貨日期欄C)
i = D(Cdr)
KLrr(i, 1) = KLrr(i, 1) + 1
KLrr(i, 2) = KLrr(i, 2) + Arr(x, SAP_PO欄M)
Next