½Ð°Ý¦p¦ó±N"ªÑ²¼¥æ©ö©ú²Ó"·J¾ã¶K¤J"³¡¦ìªí"
- ©«¤l
- 28
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 43
- ÂI¦W
- 0
- §@·~¨t²Î
- windows7
- ³nÅ骩¥»
- office2010
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2013-11-8
- ³Ì«áµn¿ý
- 2020-4-9
|
½Ð°Ý¦p¦ó±N"ªÑ²¼¥æ©ö©ú²Ó"·J¾ã¶K¤J"³¡¦ìªí"
½Ð°Ý¦p¦ó±N
¡¨¥æ©ö©ú²Ó¡¨ªí¤¤ªº©ú²Ó
¨Ì¦UªÑ¥[Á`¡¨¼Æ¶q¡¨¤ÎÁ`¡¨ª÷ÃB¡¨
¦A¨ÌӪѶR/½æ
¶K¤J¡§¡¨³¡¦ìªí¡¨¡¨¤¤ªº¶R¤J/½æ¥XªÑ¼Æ,ª÷ÃB
¦pµL®w¦s«h¨Ì¥N½X¶¶§Ç·s´¡¤J¤@¦C
¶K¤J¥N¸¹,¦WºÙ,¶R¤J/½æ¥XªÑ¼Æ,ª÷ÃB
¥d¦í¦n´X¤Ñ¤F
ÁÂÁÂÀ°¦£ |
|
¤p¤Hª«
|
|
|
|
|
- ©«¤l
- 28
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 43
- ÂI¦W
- 0
- §@·~¨t²Î
- windows7
- ³nÅ骩¥»
- office2010
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2013-11-8
- ³Ì«áµn¿ý
- 2020-4-9
|
¦^´_ 1# jasonwu0114
¦³°ª¤â¥i¥H«ü¾É¤@¤U¶Ü
ÁÂÁÂ |
|
¤p¤Hª«
|
|
|
|
|
- ©«¤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
|
¦^´_ 2# jasonwu0114
¸Õ¸Õ¬Ý- Option Explicit
- Sub Ex()
- Dim D(1 To 2) As Object, X As Integer, Rng As Range, Ar As Variant, S As String
- Set D(1) = CreateObject("SCRIPTING.DICTIONARY") '¦r¨åª«¥ó1
- Set D(2) = CreateObject("SCRIPTING.DICTIONARY") '¦r¨åª«¥ó2
- Set Rng = Sheets("¥æ©ö©ú²Ó").Range("B4")
- Do While Rng <> "" '°j°é: Ū¨ú (¶R,½æ) ¸ê®Æ
- With Rng
- If Rng = "¶R" Then X = 1 Else X = 2 '¦r¨åª«¥ó ¶R(1),½æ (2)
- If Not D(X).Exists(.Offset(, 1).Value) Then 'Exists ¦r¨åª«¥ó(KEY)¬O§_¦s¦b : ¤£¦s¦b
- D(X)(.Offset(, 1).Value) = Array(Val(.Offset(, 2)), Val(.Offset(, 2)) * .Offset(, 3).Value) '¦r¨åª«¥ó(KEY)=°}¦C
- Else '¦r¨åª«¥ó: ¦s¦b
- Ar = D(X)(.Offset(, 1).Value) '°}¦C=¦r¨åª«¥ó(KEY)
- Ar(0) = Ar(0) + Val(.Offset(, 2)) '°}¦C(0)=Ar(0)+¼Æ¦r
- Ar(1) = Ar(1) + Val(.Offset(, 2)) * .Offset(, 3) '°}¦C(1)=Ar(1)+¼Æ¦r
- D(X)(.Offset(, 1).Value) = Ar '¦r¨åª«¥ó(KEY)=°}¦C
- End If
- End With
- Set Rng = Rng.Offset(1) '¤U¤@Ó¶R,½æ¸ê®Æ
- Loop
- Set Rng = Sheets("³¡¦ìªí").Range("A5")
- Do While Rng <> "" '°j°é: Ū¨ú®w¦s(ªÑ²¼¥N¸¹)
- With Rng
- S = .Offset(, 1) & " " & Rng 'S : ¦r¨åª«¥óªº(KEY)
- If D(1).Exists(S) Then 'Exists= True: ¦r¨åª«¥ó(S)->¦s¦b
- .Range("E1") = D(1)(S)(0) 'D(1)(S)(0): ¦r¨åª«¥ó(S)¤º®e¬°°}¦C->²Ä(0)¤¸¯ÀÈ
- .Range("F1") = D(1)(S)(1)
- D(1).Remove (S) 'Remove: §â¦¨û,±q¦r¨åª«¥ó(1)²¾°£
- End If
- If D(2).Exists(S) Then
- .Range("G1") = D(2)(S)(0)
- .Range("I1") = D(2)(S)(1)
- D(2).Remove (S)
- End If
- End With
- Set Rng = Rng.Offset(1)
- Loop
- '*** µL®w¦s«h¨Ì¥N½X¶¶§Ç·s´¡¤J¤@¦C *********
- For Each Ar In D(1).KEYS 'Remove«á³Ñ¾lªº¦r¨åª«¥ó
- Rng.Resize(, 12).Insert
- 'Rng.Insert ´¡¤J«á,Rng·|¤U²¾¦b´¡¤JªºÀx¦s®æ¤U¤è,Ä~Äò´¡¤J,Rng·|¤U²¾¦b´¡¤JªºÀx¦s®æ¤U¤è
- With Rng.Offset(-1)
- .Range("A1") = Split(Ar, " ")(1)
- .Range("B1") = Split(Ar, " ")(0)
- .Range("E1") = D(1)(Ar)(0)
- .Range("F1") = D(1)(Ar)(1)
- If D(2).Exists(Ar) Then
- .Range("G1") = D(2)(Ar)(0)
- .Range("I1") = D(2)(Ar)(1)
- D(2).Remove (Ar)
- End If
- End With
- Next
- For Each Ar In D(2).KEYS
- Rng.Resize(, 12).Insert
- With Rng.Offset(-1)
- .Range("A1") = Split(Ar, " ")(1)
- .Range("B1") = Split(Ar, " ")(0)
- .Range("G1") = D(2)(Ar)(0)
- .Range("I1") = D(2)(Ar)(1)
- End With
- Next
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤l
- 28
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 43
- ÂI¦W
- 0
- §@·~¨t²Î
- windows7
- ³nÅ骩¥»
- office2010
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2013-11-8
- ³Ì«áµn¿ý
- 2020-4-9
|
¦^´_ 3# GBKEE
·P®¦!!!!¯u¬O¨ü¯q¨}¦h!!!§Ú·Q§Ú§â®Ñ½Äê¤F¤]¼g¤£¥X¨Ó
¥t¥~¦A½Ð°Ý
µ{¦¡¤¤¡§¡¨¡¨µL®w¦s«h¨Ì¥N½X¶¶§Ç·s´¡¤J¤@¦C¡¨¡¨
°õ¦æ«á¦n¹³¥u·|¦b³Ì«á©¹¤U·s¼W¤@¦C
1.¬O§_¥i·Ó©Ò¦³®w¦sªºªÑ²¼¥N¸¹¶¶§Ç´¡¤J¤@¦C©ÎªÌ³Ì«á¦A¥þ³¡°µ±Æ§Ç
2.¦]¬°Àx¦s®æ¤º¦³pºâ¤½¦¡¬O§_¥i½Æ»s¾ã¦C¦A·s´¡¤J
ÁÂÁÂ |
|
¤p¤Hª«
|
|
|
|
|
- ©«¤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
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-11-27 17:45 ½s¿è
¦^´_ 4# jasonwu0114 - Option Explicit
- Sub Ex()
- Dim D(1 To 2) As Object, X As Integer, Rng As Range, Ar As Variant, S As String
- Set D(1) = CreateObject("SCRIPTING.DICTIONARY") '¦r¨åª«¥ó1
- Set D(2) = CreateObject("SCRIPTING.DICTIONARY") '¦r¨åª«¥ó2
- Set Rng = Sheets("¥æ©ö©ú²Ó").Range("B4")
- Do While Rng <> "" '°j°é: Ū¨ú (¶R,½æ) ¸ê®Æ
- With Rng
- If Rng = "¶R" Then X = 1 Else X = 2 '¦r¨åª«¥ó ¶R(1),½æ (2)
- If Not D(X).Exists(.Offset(, 1).Value) Then 'Exists ¦r¨åª«¥ó(KEY)¬O§_¦s¦b : ¤£¦s¦b
- D(X)(.Offset(, 1).Value) = Array(Val(.Offset(, 2)), Val(.Offset(, 2)) * .Offset(, 3).Value) '¦r¨åª«¥ó(KEY)=°}¦C
- Else '¦r¨åª«¥ó: ¦s¦b
- Ar = D(X)(.Offset(, 1).Value) '°}¦C=¦r¨åª«¥ó(KEY)
- Ar(0) = Ar(0) + Val(.Offset(, 2)) '°}¦C(0)=Ar(0)+¼Æ¦r
- Ar(1) = Ar(1) + Val(.Offset(, 2)) * .Offset(, 3) '°}¦C(1)=Ar(1)+¼Æ¦r
- D(X)(.Offset(, 1).Value) = Ar '¦r¨åª«¥ó(KEY)=°}¦C
- End If
- End With
- Set Rng = Rng.Offset(1) '¤U¤@Ó¶R,½æ¸ê®Æ
- Loop
- Set Rng = Sheets("³¡¦ìªí").Range("A5")
- Do While Rng <> "" '°j°é: Ū¨ú®w¦s(ªÑ²¼¥N¸¹)
- With Rng
- S = .Offset(, 1) & " " & Rng 'S : ¦r¨åª«¥óªº(KEY)
- If D(1).Exists(S) Then 'Exists= True: ¦r¨åª«¥ó(S)->¦s¦b
- .Range("E1") = D(1)(S)(0) 'D(1)(S)(0): ¦r¨åª«¥ó(S)¤º®e¬°°}¦C->²Ä(0)¤¸¯ÀÈ
- .Range("F1") = D(1)(S)(1)
- D(1).Remove (S) 'Remove: §â¦¨û,±q¦r¨åª«¥ó(1)²¾°£
- End If
- If D(2).Exists(S) Then
- .Range("G1") = D(2)(S)(0)
- .Range("I1") = D(2)(S)(1)
- D(2).Remove (S)
- End If
- End With
- Set Rng = Rng.Offset(1)
- Loop
- Set Rng = Rng.Offset(-1).Resize(, 12)
- '*** µL®w¦s«h¨Ì¥N½X¶¶§Ç·s´¡¤J¤@¦C *********
- For Each Ar In D(1).KEYS 'Remove«á³Ñ¾lªº¦r¨åª«¥ó
- Rng.Copy '½Æ»s
- Rng.Offset(1).Insert Shift:=xlDown '¤U¤@¦C´¡¤W½Æ»sªºÀx¦s®æ
-
- With Rng.Offset(1)
- .SpecialCells(xlCellTypeConstants, 3) = "" '²M°£ ¤U¤@¦C´¡¤W½Æ»sªºÀx¦s®æªº[¤å¦r,¼Æ¦r]
- .Range("A1") = Split(Ar, " ")(1)
- .Range("B1") = Split(Ar, " ")(0)
- .Range("E1") = D(1)(Ar)(0)
- .Range("F1") = D(1)(Ar)(1)
- If D(2).Exists(Ar) Then
- .Range("G1") = D(2)(Ar)(0)
- .Range("I1") = D(2)(Ar)(1)
- D(2).Remove (Ar)
- End If
- End With
- Set Rng = Rng.Offset(1)
- Next
- For Each Ar In D(2).KEYS
- Rng.Copy
- Rng.Offset(1).Insert Shift:=xlDown
- With Rng.Offset(1)
- .SpecialCells(xlCellTypeConstants, 3) = ""
- .Range("A1") = Split(Ar, " ")(1)
- .Range("B1") = Split(Ar, " ")(0)
- .Range("G1") = D(2)(Ar)(0)
- .Range("I1") = D(2)(Ar)(1)
- End With
- Set Rng = Rng.Offset(1)
- Next
- Set Rng = Rng.Offset(-1).CurrentRegion 'CurrentRegion:©µ¦ùªº½d³ò
- '********* ±Æ§Ç :¥DÁäªÑ²¼¥N¸¹
- Rng.Sort Key1:=Rng.Cells(1), Order1:=xlAscending, Header:=xlGuess, _
- OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, SortMethod _
- :=xlStroke, DataOption1:=xlSortNormal
- End Sub
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|