- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 250
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-18
|
¥»©«³Ì«á¥Ñ Hsieh ©ó 2012-2-7 01:23 ½s¿è
¦^´_ 2# owen9399
¥i»s§@¤@Ó¤ÀÃþªí
¦A¥H¤ÀÃþªí¬°¼Ð·Ç¨Ó¤ÀÃþ¦p¹Ï
- Sub nn()
- Dim Ar(2), Ay()
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("Sheet1")
- Ar(0) = Array(.[A1].Value, .[B1].Value, .[C1].Value, .[D1].Value, .[E1].Value)
- For Each a In .Range("E2", .[E65536].End(xlUp))
- i = IIf(InStr(a, "¿¤") > 0, 4, 1)
- mystr = Mid(a, i, 3)
- Set B = .Columns("I:K").Find(mystr, lookat:=xlWhole)
- If B Is Nothing Then
- ky = 5
- Else
- ky = .Cells(B.Row, "H").Value
- End If
- If IsEmpty(d(ky)) Then
- Ar(1) = Array(a.Offset(, -4).Value, a.Offset(, -3).Value, a.Offset(, -2).Value, a.Offset(, -1).Value, a.Value)
- d(ky) = Ar
- Else
- Ay = d(ky)
- s = UBound(Ay)
- ReDim Preserve Ay(s + 1)
- Ay(s) = Array(a.Offset(, -4).Value, a.Offset(, -3).Value, a.Offset(, -2).Value, a.Offset(, -1).Value, a.Value)
- d(ky) = Ay
- Erase Ay
- End If
- Next
- End With
- With Sheets("Sheet2")
- .[A:F] = ""
- r = 1
- For Each ky In d.keys
- For i = LBound(d(ky)) To UBound(d(ky))
- .Cells(r, "A").Resize(, 5) = d(ky)(i)
- r = r + 1
- Next
- Next
- End With
- End Sub
½Æ»s¥N½X |
|