- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 253
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-22
|
¦^´_ 5# gameshop - Sub ex()
- Set d = CreateObject("Scripting.Dictionary") '³Ð«Ø¦r¨åª«¥ó¬ö¿ý¸s²Õ¤é´Á®t
- Set d1 = CreateObject("Scripting.Dictionary") '³Ð«Ø¦r¨åª«¥ó¬ö¿ý¸s²Õ³Ì¤p¤é´Á®t
- With Sheets(1) '¸ê®Æ¤u§@ªí
- ar = .Range("A1").CurrentRegion '¸ê®Æ©Ò¦³½d³ò°O¿ý¨ì°}¦C
- d1(ar(1, 1)) = Application.Index(ar, 1) '«Ø¥ß¼ÐÃD¦C
- For i = 2 To UBound(ar, 1) '±q²Ä2¦C¶}©l°j°é
- s = Date - ar(i, 2) '¤é´Á®t
- If s >= 0 Then '¤é´Á®t¬°¥¿È
- If IsEmpty(d(ar(i, 1))) Then d(ar(i, 1)) = s '°²¦p¸s²ÕÁÙ¨S¸ê®Æ¡A´N±N¤é´Á®t¥[¤J¸s²Õ
- If s <= d(ar(i, 1)) Then d(ar(i, 1)) = s: d1(ar(i, 1)) = Application.Index(ar, i) '¤ñ¸û¤é´Á®t«á°O¿ý¸Ó¦C¸ê®Æ¨ì¦r¨å¹ïÀ³¸s²Õ¤º
- End If
- Next
- End With
- Sheets(2).Range("A1").CurrentRegion.ClearContents '²M°£Â¦³¸ê®Æ
- Sheets(2).[A1].Resize(d1.Count, UBound(ar, 2)) = Application.Transpose(Application.Transpose(d1.items)) '¼g¤J¸ê®Æ
- End Sub
½Æ»s¥N½X |
|