- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 1# john2006168
¨Ï¥ÎDictionary ª«¥ó ¸Õ¸Õ¬Ý- Sub Ex()
- Dim D As Object, E, S As String, S1 As String
- Set D = CreateObject("SCRIPTING.DICTIONARY")
- With Sheets("Sheet2")
- For Each E In .Range("E2", .[E2].End(xlDown))
- If D.EXISTS(E.Value) = False Then
- D(E.Value) = Array(E.Offset(, -3), E.Offset(, -4))
- Else
- S = "," & D(E.Value)(0) & ","
- If InStr(S, "," & E.Offset(, -3) & ",") = 0 Then
- S = D(E.Value)(0) & "," & E.Offset(, -3)
- Else
- S = D(E.Value)(0)
- End If
- S1 = "," & D(E.Value)(1) & ","
- If InStr(S1, "," & E.Offset(, -4)) & "," = 0 Then
- S1 = D(E.Value)(1) & "," & E.Offset(, -4)
- Else
- S1 = D(E.Value)(1)
- End If
- D(E.Value) = Array(S, S1)
- End If
- Next
- End With
- With Sheets("Sheet1")
- For Each E In .Range("C3", .[C3].End(xlDown))
- If D.EXISTS(E.Value) Then
- E.Offset(, 9) = D(E.Value)(0)
- E.Offset(, 10) = D(E.Value)(1)
- Else
- E.Offset(, 9) = "No received"
- E.Offset(, 10) = ""
- End If
-
- Next
- End With
- End Sub
½Æ»s¥N½X |
|