- ©«¤l
- 703
- ¥DÃD
- 276
- ºëµØ
- 0
- ¿n¤À
- 1005
- ÂI¦W
- 1
- §@·~¨t²Î
- Windows 10
- ³nÅ骩¥»
- Office 2019
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-6-30
- ³Ì«áµn¿ý
- 2024-5-29
|
¦^´_ 2# samwang
¥Ñ°J·PÁ«e½úªºÀ°§U¡A§Ú¤]§V¤O¬ã¨s¾Ç²ß¤¤¡A¨Ã¼Ð¥Ü¤Fµù¸Ñ¡A¤£ª¾¹D¬O§_¦³»~¡AÁٽФj¤j¦³ªÅ¦A¬Ý¡AÁÂÁ¡I- Dim Arr, xD, Brr(1 To 1000, 1 To 2), i&, n%, sh% '«Å§iÅܼÆ
- Set xD = CreateObject("Scripting.Dictionary") '³]©wxD¬°¦r¨åª«¥ó
- For sh = 2 To Sheets.Count '¤u§@ªí2~¤u§@ªíÁ`¼Æ,For°j°ésh(«Å§i¬°int)
- With Sheets(sh) '¶i¤J¤u§@ªí,¥Hsh¥N¤J
- Arr = .[a1].CurrentRegion '¿ï¨úa1¥]§t¾Fªñªº©Ò¦³½d³ò,Arr¬°²Õ¼Æ
- For i = 2 To UBound(Arr) '²Ä2¦C~Arrªº¦C¤W,For°j°éi(«Å§i¬°Long)
- If xD.Exists(Arr(i, 1)) Then '¦C¬OÅܰʪº¡AAÄæ¬O©T©wªº¡Ai¥N¤J¦C¡A§PÂ_¦r¨å¸Ìªºkey¦³¨S¦³Arr(i, 1)¡A¦pªG¦³´N©¹¤U°µ
- If Not xD.Exists(Arr(i, 1) & "|" & Sheets(sh).Name) Then '¦pªG¦r¨å¸Ìªºkey¨S¦³Arr(i, 1)´N¦s¤J¦r¨å¸Ì¡A³s¦P¤u§@ªí¦WºÙ
- n = n + 1: Brr(n, 1) = Arr(i, 1) '±NArr(i, 1)«½Æªº¸ê®Æ¦sµ¹Brr(n, 1)
- Brr(n, 2) = Sheets(sh).Name '±NArr(i, 1)«½Æ®Éªº¤u§@ªí¦WºÙ¦s¤JBrr(n, 2)
- End If
- xD(Arr(i, 1) & "|" & Sheets(sh).Name) = "" '¦pªG¦r¨å¸Ìªºkey¦³Arr(i, 1)´N¦s¤J¦r¨å¸Ì¡A³s¦P¤u§@ªí¦WºÙ
- Else '§PÂ_¦r¨å¸Ìªºkey¦³¨S¦³Arr(i, 1)¡A¦pªG¨S¦³´N©¹¤U°µ
- xD(Arr(i, 1)) = "" '±NArr(i, 1)¦s¤J¦r¨å¸Ì
- End If
- Next
- End With
- xD.RemoveAll '²MªÅ¦r¨å¤¤ªº¼Æ¾Ú
- Next
- If n > 0 Then '¦pªG¦³§ä¨ì«½Æªº¸ê®Æ©¹¤U°µ
- With Sheets("Á`ªí")
- .[a1].CurrentRegion.Offset(1) = "" '²MªÅA¡BBÄæ¼Æ¾Ú¡A«O¯d¼ÐÃD
- .Range("a2").Resize(n, 2) = Brr '±NBrr²Õ¼ÆÄÀ©ñ¨ìA¡BBÄæ
- End With
- End If
½Æ»s¥N½X |
|