ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] Aªí¨C³æµ§¸ê®Æ¥h¬d¸ßBªí ±o¥X¦h¦C¸ê®Æ ½Æ»s¨ìCªí [0613]¦¨¥\ÂP

[µo°Ý] Aªí¨C³æµ§¸ê®Æ¥h¬d¸ßBªí ±o¥X¦h¦C¸ê®Æ ½Æ»s¨ìCªí [0613]¦¨¥\ÂP

¥»©«³Ì«á¥Ñ milkpillow ©ó 2010-6-14 23:54 ½s¿è

¦U¦ì«e½ú
³o­Ó¼ÐÃD·Q¤F¤Q¤ÀÁ馳... ¤£¬O«Ü½T¤Á.½Ð¨£½Ì~_~

Aªí ¦³«Ü¦hµ§¸ê®Æ ID ¬O¤£­«½Æªº
Bªí ¦³«Ü¦hµ§¸ê®Æ SID ·|­«½Æ ¦ý¬O­È¤£·|­«½Æ (¦n¹³¤]¤£¹ï... À³¸Ó¬O ID+­È ¤£·|­«½Æ)
Cªí ¬O­n¿é¥Xµ²ªG¼Ë¤l (§Ú³£¥Î¤â°µ ¤@¦Êµ§¸ê®Æ´N­n¨â¤p®É...)

§Ú¤â°Êªº¾Þ§@¤è¦¡¡G
Aªíªº²Ä¤@µ§¸ê®Æ ªº STÄæ ½Æ»s¸Ó­È
¤Á´«Bªí ¨Ï¥Î¶i¶¥¿z¿ï¥\¯à ±o¥X¤Tµ§¥i¥Î¸ê®Æ (³o­Ó´Xµ§¨Ã¤£©T©w¡A°ò¥»¤WÀ³¸Ó¦Ü¤Ö¦³¤@µ§...)
¤Á´«Cªí ±N¤Tµ§¥i¥Î¸ê®Æ ½Æ»s¨ìCªí¶K¤W ¨Ã¥B§âAªíªºID ¸òPAGE¸ê°T¤]½Æ»s¹L¥h
¦^Aªíªº²Ä¤Gµ§¸ê®Æ¦AÄ~Äò½Æ»s..
¤â°Ê°j°é¨â­ÓÄÁÀY¤§«á ¤@¦Êµ§§¹¦¨...

¯uªº«ÜÃø¥Î°ê»y±Ô­z... ¦Ó¥B°µ°_¨Ó«Ü¶O®É¶¡..
§Ú·Ç³Æ¤F¤@­ÓÀÉ®× ½Ð«e½ú­Ì«üÂI¤@¤U.. ¸Ì­±§Ú¦³¼gµù¸Ñ..©È¤£©úÅã ©Ò¥H¥ÎÅã¥Ü ¥i¯à·|ê²´..

§Ú¥Îºô¸ô¬d¨ì ºô¯¸¦³½g¤å³¹«Ü¹³¦³Ãö«Y ¦ý¤w¸gµLªkµù¥U¸òÆ[¬Ý.. >"<
http://gb.twbts.com/index.php?topic=12801.0

¥H¤W ³Â·Ð±z(s)¤F

pro.zip (12 KB)

®Ä¯à¦p¦ó´N¬Ý§A°O¾ÐÅé°÷¤£°÷
¦pªGÅܼƳ£§¹¦¨«Å§i´N·|¦n¤@ÂI
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

  1. Sub matchdata()
  2. Dim Ay() '¥þ°ìÅܼÆAy¥Î¨Ó©ñ³Ì²×µ²ªG
  3. Set d = CreateObject("Scripting.Dictionary") '³Ð¥ß¤@­Ó ¤Gºû°}¦Cªºª«¥ód
  4. With Sheet2
  5.   For Each A In .Range(.[A2], .[A65536].End(xlUp)) '²Ä¤G±iªíªºAÄæ ³v¦C =¼È¦sÅܼÆA
  6.      If d.exists(A.Value) = False Then '¥ÎDictionaryªºExists¨ç¼Æ ¨ÓÀˬd¤ñ¹ïAªº­È¦pªG¨S¦³«h°õ¦æ¤U¤@¦æ
  7.         d(A.Value) = Join(Array(A, A.Offset(, 1), A.Offset(, 2), A.Offset(, 3)), ",") '¨ú­È?? ¾î¦Vªº 1A,1B,1C Âæ
  8.         Else '¦pªG¦³
  9.         d(A.Value) = d(A.Value) & ";" & Join(Array(A, A.Offset(, 1), A.Offset(, 2), A.Offset(, 3)), ",") '¦êÁp°_¨Ó¥Î;¹j¶} Åܦ¨1A,1B,1C;2A,2B,2C ¨ú¥Xªº®É­Ô·|Åܦ¨¨â¦C©Î§ó¦h¦Cªº¤TÄæ¸ê®Æ
  10.      End If
  11.     Next
  12. End With
  13. With Sheet1
  14.    For Each A In .Range(.[C2], .[C65536].End(xlUp)) '²Ä¤@±iªíªºCÄæ ³v¦C =¼È¦sÅܼÆA
  15.       If d.exists(A.Value) = True Then '¤Gºû°}¦Cdªºª«¥ó ­Y¦³¥]§t³o¦¸ªºÅܼÆa
  16.          Ar = Split(d(A.Value), ";") '¨ú¥X¥i¥Îªº¼Æµ§¸ê®Æ ª½¦Vªº ¥i¥Îµ§¼Æ X ABC¤TÄæ  
  17.          For i = 0 To UBound(Ar) '0¨ì °}¦CArªº³Ì¤j­È
  18.          ReDim Preserve Ay(s) '«O¦s°ÊºA°}¦Cªº¤º®e (¬°¤°»òÀx¦s¼g¦b«e­± ³B²z¤è¦¡¼g¦b¤U¤@¦æ?)
  19.          Ay(s) = Split(A.Offset(, -2) & "," & A.Offset(, -1) & "," & Ar(i), ",")
  20.          s = s + 1 '¥Ø«e¦C+1
  21.          Next
  22.          Else
  23.          If mystr = "" Then mystr = A Else mystr = mystr & "," & A '­Yd.exists(A.Value) = false ¼g¤J¤@­Óĵ§iÅã¥Ü¥Ø«eÅܼÆA
  24.         End If
  25.     Next
  26. End With
  27. With Sheet3
  28. .[A2:F65536] = "" '²MªÅ²Ä¤T±iªí
  29. .[A2].Resize(s, 6) = Application.Transpose(Application.Transpose(Ay)) '²Ä¤T±iªí ªºA2Äæ ¶}©l¼g¤JÂà´«¹Lªº¦æ¦C Âà´«¤F¨â¦¸ ¶W²`¶ø µLªk·Q¹³..
  30. MsgBox mystr & "¨S§ä¨ì" '¼u¥Xĵ§iµøµ¡
  31. End With
  32. End Sub
½Æ»s¥N½X
Hsieh ¤j¤j ¥Ø«eÀ³¥Î¥¿½T¤F
³o¬O§Ú¥Ø«e¦Û¤v¼gªºª`¸Ñ ¤£ª¾¹D¬O¤£¬O¥¿½T..
¥t¥~·Q½Ð°Ý¤@¤U
¬°¤°»ò­n¥ýŪ¤J¥þ³¡ªºSheet2ªºÄæ¦ì¡A­YSheet2¦³¦n´X¸Uµ§ªº®É­Ô ¦³¨S¦³®Ä¯à°ÝÃD§r?
³B²z¹Lµ{¤¤ ¦³§âÅܼƩî¶} Split ¤S²Õ¦X Join §Ú¤£¬O«Ü¤F¸Ñ¨º¨Ç
¦³¨S¦³¤°»ò¿ìªk ¥i¥H¬Ý¨ìd(A.Value) ªº­È¬O«ç»òÅܤƪº©O?

(§Ú¯uªº¬O¶W¶W¶W·s¤â¡A®ÇÃ䪺¤£­n¯º )

TOP

¦^´_ 9# milkpillow

¸Õ¸Õ¬Ý¬O¤£¬O³o¼Ëªº·N«ä
  1. Sub matchdata()
  2. Dim Ay()
  3. Set d = CreateObject("Scripting.Dictionary")
  4. With Sheet2
  5.   For Each A In .Range(.[A2], .[A65536].End(xlUp))
  6.      If d.exists(A.Value) = False Then
  7.         d(A.Value) = Join(Array(A, A.Offset(, 1), A.Offset(, 2), A.Offset(, 3)), ",")
  8.         Else
  9.         d(A.Value) = d(A.Value) & ";" & Join(Array(A, A.Offset(, 1), A.Offset(, 2), A.Offset(, 3)), ",")
  10.      End If
  11.     Next
  12. End With
  13. With Sheet1
  14.    For Each A In .Range(.[C2], .[C65536].End(xlUp))
  15.       If d.exists(A.Value) = True Then
  16.          Ar = Split(d(A.Value), ";")
  17.          For i = 0 To UBound(Ar)
  18.          ReDim Preserve Ay(s)
  19.          Ay(s) = Split(A.Offset(, -2) & "," & A.Offset(, -1) & "," & Ar(i), ",")
  20.          s = s + 1
  21.          Next
  22.          Else
  23.          If mystr = "" Then mystr = A Else mystr = mystr & "," & A
  24.         End If
  25.     Next
  26. End With
  27. With Sheet3
  28. .[A2:F65536] = ""
  29. .[A2].Resize(s, 6) = Application.Transpose(Application.Transpose(Ay))
  30. MsgBox mystr & "¨S§ä¨ì"
  31. End With
  32. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ milkpillow ©ó 2010-6-12 16:15 ½s¿è

§Ú±NÀÉ®×¥þ³¡¾ã²z¦¨¤f»y¸ÜªºÄæ¦ì¦WºÙ
¨Ã¥B§R¥h¨S¦³¥Î¨ìªº.
¥[¤W¤F½bÀY¸òÃC¦â»¡©ú
§Æ±æ³o¼Ë¥i¥H¤ñ¸û¦n²z¸Ñ...
³Ò·Ð¤F ÁÂÁ±z¡ã

¦pªþ¥ó
QQ2.zip (24.84 KB)


¨S¦³°µ¤°»òªº½s¿è ¥u¬O¨S¦³¤H¬Ý¨£§Ú..

TOP

¦^´_ 7# milkpillow


    A¦¬¶°ªº«~¦W¸òB¥þ³¡¸ê®ÆªºOS_NAME¦³¬Æ»òÃö³s¹ïÀ³¯Á¤Þ?
©Î¬O½T©w¼Æ¶q·|¬Û¦P?
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

Hsieh ¤j

³o­Ó ¬O»s³y·s°Ó«~¿ï¶µ¥ÎªºSQL¥Îªº..
¦³³S¤k¤W¦ç ¦³ªøT µuT ¦ý¬O¦U¦³¥Õ¦â¯»¬õÂŦâ¡A¥t¥~¤@­Ó±¡ªp «h­I¤ßA ¥u¦³¶À¦â¶Â¦â.
¨º»ò¦UºØ°Ó«~ ¦³ªºÃC¦â¨Ã¤£¤@©w.
¥Ø«e°µªº¬O±qªº«¬¸¹ ¥h¨ú±o³o­Ó°Ó«~¦³¤°»ò¦âªº¿ï¶µ.(´N¬OA¦¬¶°ªºCÄæ¦ì  ¹ïÀ³  B¥þ³¡¬ö¿ý ±o¥X¦h¦C¥i¥Î¸ê®Æ)
¨Ã±N²£¥Íªº ·sªº¿ï¶µ¶ë¨ì¸ê®Æ®w¤¤.
¨º»ò¦b¹ê»ÚÀ³¥Î¤W­± ¨C­Ó·s°Ó«~³£¦Ü¤Ö·|¦³¤@­Ó¿ï¶µ(¶°).

©Ò¥H¥Ø«eªº°ÝÃD¬O. (¤U­±±Ô­z½Ð¬d¬Ý¤W­±ªºªþÀÉQQ)
·s«¬¸¹A01~A05 ³£»Ý­n¦P¤@­ÓÃC¦â¿ï¶µ¶°555.(¸Ó¶°¦X¦³1¡B5¡B6¡B18¡B25¡B30¡B75ªºÃC¦â)
¦ý¬O¥L¥u·|§ì¨ìA01 ªº ÃC¦â¿ï¶µ¶°555
¹ê»Ú¤WA02~A05 À³¸Ó­n¤À§O²£¥Í¥X ÃC¦â¿ï¶µ¶°555.(¸Ó¶°¦X¦³1¡B5¡B6¡B18¡B25¡B30¡B75ªºÃC¦â)
¡ô¦]¬°¥L­Ì¾Ö¦³¬Û¦PªºÃC¦â¶°555

½Ð±z¦AÀ°§Ú¶O¯«¤@¤U ÁÂ¥ý

TOP

¦^´_ 5# milkpillow


    ³o¼Ë2­ÓªíªºÃöÁp©Ê¤£¨¬
¨Ã¤£ª¾¹D¨Cµ§½T©wªº¤ñ¹ï¹ï¶H
½Ð»¡©ú2ªí¸ê®Æªº¤ñ¹ï³W«h
­«·s«ä¦ÒÅÞ¿è
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ milkpillow ©ó 2010-6-10 12:48 ½s¿è

½Ð±Ð Hsieh »P ¦U¦ì«e½ú.
¹ê»ÚÀ³¥Î«áµo²{ ­«½Æªº­È ¥L¤£·|³B²z¥X¨Ó.(¦pªþ¥ó)
§Ú¬Ý¤F´X­Ó¤p®É ¹ê¦b¬O¤£¬Æ¤F¸Ñ...



Sub AA_Table()
Dim A As Range, C As Range, Ar() //©w¸qÅܼÆ
With Sheets("B¥þ³¡¬ö¿ý")      //¥ÎBªí
For Each A In .Range(.[A2], .[A1048576].End(xlUp)) //AÄæ ³v¦C³B²z
   Set C = Sheets("A¦¬¶°").Columns("C").Find(A, lookat:=xlWhole) //¦bA¦¬¶°ªºcÄæ ´M§äA . ¬O¤£¬O³oÃäÀ³¸Ó­n¤Ï¹L¨Ó¼g  ¦bB¥þ³¡¬ö¿ýAÄæ ´M§äA?
     If Not C Is Nothing Then
       ReDim Preserve Ar(s)
       Ar(s) = Array(C.Offset(, -2).Value, C.Offset(, -1).Value, A.Offset(, 1).Value, A.Offset(, 2).Value, A.Offset(, 3).Value) //³]©w C¿é¥X¤­Ä檺­È
       s = s + 1
   End If
Next
End With
Sheets("C¿é¥X").[A2:E1048576].Clear
If s > 0 Then Sheets("C¿é¥X").[A2].Resize(s, 5) = Application.Transpose(Application.Transpose(Ar))
Sheets("C¿é¥X").Select
End Sub

QQ.zip (21.6 KB)

TOP

§Ú¤w¤U¸ü´ú¸Õ §¹¥þ²Å¦X­n¿é¥Xªºµ²ªG
¦Ó¥B¦n¤è«K Àþ¶¡´î¤Ö§Úªº²Â¤èªk¤â°Ê°j°é ©Ò¯Ó¶Oªº®É¶¡»P¤O®ð...
¬ðµMı±o§Ú¦n´ù¤p... ³o°Ê§@¦Ü¤Ö®ö¶O§Ú¥Í©R¤¤ªº¾ã¾ã240­Ó¤p®É¦³..

³o»òÅãµÛªº´î¤Ö¤â°Ê¾Þ§@..
Åý¤p©f¹ï©óVBA§ó¦³¿³½ì¤F..
ÁöµM«Ü¦h«ü¥O¤£¤F¸Ñ §Ú¤Ó²L¤F...¦ý¬O§Ú·|¥h¬dªº..
¥ý·PÁ¨â¦ì¤j¤jªº¦^ÂÐ..

ºô¸ô¤W¦³³o­Ó½×¾Â¯u¦n~
¥@¬É¤W¦³¨â¦ì«e½ú¯u¦n~

TOP

        ÀR«ä¦Û¦b : ¦³´¼¼z¤~¯à¤À¿ëµ½´c¨¸¥¿¡F¦³Á¾µê¤~¯à«Ø¥ß¬üº¡¤H¥Í¡C
ªð¦^¦Cªí ¤W¤@¥DÃD