- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¥»©«³Ì«á¥Ñ c_c_lai ©ó 2014-5-31 10:52 ½s¿è
¦^´_ 1# ii31sakura
¨S¯d·N§A¤´¬O¤p¾Ç¥Íµ¥¯Å¡A¬OµLªk¤U¸üªº¡C
©Ò¥H±Nµ{¦¡½X¶K¤W¡G- Sub Ex()
- Dim ²Ä¤@ºØ²Õ¦X As Object, ²Ä¤GºØ²Õ¦X As Object, rng As Range
-
- Set ²Ä¤@ºØ²Õ¦X = CreateObject("Scripting.Dictionary")
- Set ²Ä¤GºØ²Õ¦X = CreateObject("Scripting.Dictionary")
-
- With Sheets("DATA")
- ' .[F:L].ClearContents ' «O¯d½Æ»s¼ÐÃD
- .[F12:L65535].ClearContents
- For Each rng In .Range([A2], [A2].End(xlDown)) ' ¨C¤é
- If IsEmpty(²Ä¤@ºØ²Õ¦X(rng.Value & rng.Offset(, 1).Value & rng.Offset(, 2).Value)) Then ' ¼g¤J¦r¨å
- ²Ä¤@ºØ²Õ¦X(rng.Value & rng.Offset(, 1).Value & rng.Offset(, 2).Value) = Array(rng.Value, rng.Offset(, 1).Value, rng.Offset(, 2).Value, Val(rng.Offset(, 3).Value))
- Else
- ²Ä¤@ºØ²Õ¦X(rng.Value & rng.Offset(, 1).Value & rng.Offset(, 2).Value) = Array(rng.Value, rng.Offset(, 1).Value, rng.Offset(, 2).Value, ²Ä¤@ºØ²Õ¦X(rng.Value & rng.Offset(, 1).Value & rng.Offset(, 2).Value)(3) + Val(rng.Offset(, 3).Value))
- End If
-
- If IsEmpty(²Ä¤GºØ²Õ¦X(rng.Offset(, 1).Value & rng.Offset(, 2).Value)) Then ' ¼g¤J¦r¨å
- ²Ä¤GºØ²Õ¦X(rng.Offset(, 1).Value & rng.Offset(, 2).Value) = Array(rng.Offset(, 1).Value, rng.Offset(, 2).Value, Val(rng.Offset(, 3).Value))
- Else
- ²Ä¤GºØ²Õ¦X(rng.Offset(, 1).Value & rng.Offset(, 2).Value) = Array(rng.Offset(, 1).Value, rng.Offset(, 2).Value, ²Ä¤GºØ²Õ¦X(rng.Offset(, 1).Value & rng.Offset(, 2).Value)(2) + Val(rng.Offset(, 3).Value))
- End If
- Next
-
- .[F12].Resize(²Ä¤@ºØ²Õ¦X.Count, 4) = Application.Transpose(Application.Transpose(²Ä¤@ºØ²Õ¦X.items)) ' ¼g¤J¤u§@ªí
- .[J12].Resize(²Ä¤GºØ²Õ¦X.Count, 3) = Application.Transpose(Application.Transpose(²Ä¤GºØ²Õ¦X.items)) ' ¼g¤J¤u§@ªí
- End With
- ' ÄÀ¥Xª«¥óÅܼÆ
- Set ²Ä¤@ºØ²Õ¦X = Nothing
- Set ²Ä¤GºØ²Õ¦X = Nothing
- End Sub
½Æ»s¥N½X |
|