- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 80
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2025-4-4
               
|
¥»©«³Ì«á¥Ñ Hsieh ©ó 2011-3-17 08:48 ½s¿è
¦^´_ 39# FAlonso
³o½g«ÂI¦b©ó°ò¥»§Þ¥©ºt½m¡A¨Ã¤£¹ªÀy¨Ï¥ÎVBA©Î¨ç¼Æ¸ÑÃD
¬JµM¥S¥x¨Ï¥ÎVBA¨Ó°µ¡A¦Ó¥B±z¤]´£¨ì¤@¨ÇVBA¨Ï¥Î¤Wªº§xÂZ
©³¤Uµ{¦¡½X¨Ñ±z°Ñ¦Ò¬Ý¬Ý
±z·|µo¥Í¿ù»~ì¦]¥i¯àµo¥Í¦b
dictionaryª«¥ó¥[¤J¶µ¥Øªº¤èªk
±z¨Ï¥Î¤Fadd¤èªk¨Ó¥[¤J¶µ¥Ø
dictionaryª«¥ó¦³¤@Ó¯S©Ê¡A´N¬O¯Á¤ÞȤ£¯à«ÂÐ
·íadd¤èªk¥[¤J¯Á¤Þ®É¡AY¸Ó¯Á¤ÞȤw¸g¦s¦b´N·|²£¥Í¿ù»~
ÁקK¦¹±¡ªpµo¥Í¡A¥i¥Îexists¤èªk¥ý§PÂ_¯Á¤ÞȬO§_¦s¦b¡AµM«á¦A¨M©w¬O§_¥[¤J
¦b±zªº¬yµ{¤¤dictionaryª«¥ó¬O¥Î¤£¨ìªº
¦Ó©³¤Uµ{¦¡½X§Q¥Îªº¤èªk¬Oª½±µ«ü©w¯Á¤ÞȹïÀ³ªºÈ
³o¼Ë¡AÈ·|§ïÅÜ¡A¦ý¤£·|¦³«½Æ¯Á¤ÞºÃ¼{
¦A«h±z´£¨ì³t«×°ÝÃD
¥[§Ö³t«×ªº¤èªk¦]ӮצU¦³¤£¦P
¥H¥»ÃD¬°¨Ò¡Aº¥ý¬O±N¸ê®Æ½d³ò¥H°}¦C«¬ºAŪ¨ú
ª½±µ¾a°O¾ÐÅéŪ¼g¡A·|¤ñ¤@®æ¤@®æªºÅª¼g§Ö«Ü¦h
¦b¨Ó¬O·í§An«ü©wÀx¦s®æ®É¡An¾¨¶q´î¤Öselectªº¨Ï¥Î
ª½±µ«ü©wÄæ¦C¦ì¤]·|¨Ï³t«×¥[§Ö
´î¤Ö¤£¥²nªº´`Àô»P°Ê§@³£¬O¥[³tªº¤èªk
±z¥i¥H¦Û¤v¸Õ¸Õ¬Ý- Sub Ex()
- Dim d As Object, d1 As Object, d2 As Object, Ar(), i&, A As Range, C As Range
- Set d = CreateObject("Scripting.Dictionary")
- Set d1 = CreateObject("Scripting.Dictionary")
- Set d2 = CreateObject("Scripting.Dictionary")
- d2("¦Ò¥Í¸¹") = "©m¦W"
- Ar = Range([A1], [A65536].End(xlUp).Offset(, 3))
- For i = 2 To UBound(Ar, 1)
- d(Ar(i, 1) & Ar(i, 3)) = IIf(Ar(i, 4) < 65, "C", IIf(Ar(i, 4) < 85, "B", "A"))
- d1(Ar(i, 3)) = ""
- d2("'" & Ar(i, 1)) = Ar(i, 2)
- Next
- [G:Q].ClearContents
- Application.ScreenUpdating = False
- [G1].Resize(d2.Count, 1) = Application.Transpose(d2.keys)
- [H1].Resize(d2.Count, 1) = Application.Transpose(d2.items)
- [I1].Resize(, d1.Count) = d1.keys
- For Each A In Range([I1], [I1].End(xlToRight))
- For Each C In Range([G2], [G65536].End(xlUp))
- Cells(C.Row, A.Column) = d(C & A)
- Next
- Next
- End Sub
½Æ»s¥N½X |
|