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

[µo°Ý] ¥u·Q­n§ì¨ú²Å¦X±ø¥óªº"²Ä¤@µ§"¨ä¥L¤£­n

[µo°Ý] ¥u·Q­n§ì¨ú²Å¦X±ø¥óªº"²Ä¤@µ§"¨ä¥L¤£­n

¦U¦ì°ª¤â«e½ú~
«÷«÷´ê´ê§Ë¤F¤U­±ªºµ{¦¡½X,¥i¥Hº¡¨¬¨ì¥Ø«eªº»Ý¨D~¦ý¬O°õ¦æ³t«×¦nºC~
¥Ø«e¥i¥H­×¥¿§Úªºµ{¦¡½X~¥Î§ó¦nªº¤è¦¡½Õ¾ã¶Ü?

§Ú·Q­n±N  ²Å¦X§Úµ¹ªº±ø¥ó ¥h A row´M§ä
§ä¨ì²Å¦X§Ú­nªº­È®É,´N©¹¤W·j¯Á¨ì²Å¦X±ø¥óªºÄæ¦ì,§â³o­ÓÄæ¦ìªº­È §ì¨«
¥i¬O§Ú¥u­n§ì²Å¦X±ø¥óªº²Ä¤@µ§¸ê®Æ,¨ä¥Lªº¤£­n~
´N³o¼Ë,§Ú¥Î¤F¿ý»s»E¶°ªº¤è¦¡~~¶Ì¶Ì¦a§¹¦¨¤F
¥i¬O³o¤£¬O§Ú·Q­nªº³t«×~¦nºC³á
¦³¾÷·|½Õ¾ã¶Ü?Àµ¨D«üÂI¤@¤G

¦³·Q¹L¥á¨ì°}¦C¥h~¦ý¥Ø«eÁÙ¤£·|¦p¦ó¥h°}¦C·j¯Á²Å¦X§Ú­nªº²Ä¤@µ§¸ê®Æ~¦]¬°·|¦³«Ü¦hµ§Ãþ¦ü
Àµ¨D«üÂI¤@¤G
Å¥¦P¾Ç»¡~~¤èªk«Ü¦hºØ~¦ý§ÚÁÙ¨S¦³¶}¬ ORZ:'(

Sub TEST ()
Dim zz As String

For i = 2 To Cells(Rows.Count, 10).End(xlUp).Row
    zz = Cells(i, 10).Value
    Columns("A:A").Select

    Selection.Find(What:=zz, after:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, MatchByte:=False, SearchFormat:=False).Activate

    Cells.Find(What:="  (net ", after:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, _
        MatchCase:=False, MatchByte:=False, SearchFormat:=False).Activate

    Cells(i, 11) = ActiveCell
    Cells(i, 11) = Right(Cells(i, 11), Len(Cells(i, 11)) - 7)

  Next
  Cells(1, 10).Select


End Sub

¦^´_ 19# boblovejoyce


    ¥u¬O­Ó¤HÅÞ¿è«ä¦Ò³ß¦n¡A¥H¤Î­n³]©w ¤U­­¬°1ªº°}¦C¤£¥²¨C­Ó ¤À§O©w¸q "1 to ...."
¦b¨Ï¥Î¤W­nª`·Nªº¬O Excel ¬Y¨Ç²£¥Í°}¦Cªº¨ç¼Æ¤£¨ü¼vÅT¡A¸I¨ì¹L¡A¦ý§Ñ°O¤F

2010 VBA »¡©ú "Array ¨ç¼Æ©Ò«Ø¥ßªº°}¦C¹w³]¤U­­¥²¬°¹s¡A¤£¨ü Option Base ©Ò¼vÅT" ¡A¦n¹³¬O¿ù»~ªº¡C

TOP

¦^´_ 16# Scott090
Option Base 1
«Å§i°_©l°}¦C±q1¶}©l
¥¦ªº¦n³B©Î¬O¨Ï¥Î¤W ¦³¤°»ò¯S§O¤§³B?

TOP

¦^´_ 16# Scott090
­è­è´ú¸Õ§¹²¦~¤j¤jªº¤S§ó¯«³t¤F~·PÁ¤j¤j«ü¾É

TOP

¦^´_ 16# Scott090
@@ ©ú¤Ñ¥h´ú¸Õ¤@¤U
²{¦b¥u¦³¤â¾÷¥i¥Î
²{Á¹L¤F,¤§«á¦A¨Ó¦^³ø©M°Ý°ÝÃD

TOP

¦^´_ 7# boblovejoyce

¦pªG¨Ï¥Î  °}¦C¾Þ§@¡A ¦b§Úªº¹q¸£¥u­n 0.324¬í¡F¥u°µ°Ñ¦Ò¡G
  1. Option Base 1

  2. Sub test1()
  3. t = Timer
  4. Dim arr, arr1, arr2
  5. Dim i&, j&, k&
  6. arr1 = Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row)
  7. arr = Range("J2:J" & Cells(Rows.Count, 10).End(xlUp).Row)
  8. ReDim arr2(UBound(arr), 1)
  9. For i = 1 To UBound(arr)
  10.     For j = UBound(arr1) To 1 Step -1
  11.         If InStr(arr1(j, 1), arr(i, 1)) <> 0 Then
  12.             For k = j To 1 Step -1
  13.                 If InStr(arr1(k, 1), "  (net ") <> 0 Then
  14.                     arr2(i, 1) = Right(arr1(k, 1), Len(arr1(k, 1)) - 7) '    '²¾¢X£«e¡Ó8Ó¦r¤¸
  15.                     GoTo Nexti
  16.                 End If
  17.             Next
  18.         End If
  19.     Next
  20. Nexti:
  21.   Next
  22.    Range("L2").Resize(UBound(arr2)) = arr2
  23. MsgBox Format(Timer - t, "0.0000")
  24. End Sub
½Æ»s¥N½X

TOP

·PÁ¨â¦ì»¡©ú
§ÚÀ´¤F

Ok,§Ú¦A¥hŪ»¡©ú¤@¤U

TOP

¦^´_ 12# boblovejoyce

¦pª©¤jªº¦^µª¡A»Ý­n¨º»ò¦h³rÂI¡A¬O¬Ù²¤°Ñ¼Æ©ÎÀq»{¹w³]­È¡A³Ì«áªº2«h¬OXlSearchDirectionªº­È¦p¤U»¡©ú¡A¥¦¥i¥H¥Î¦WºÙ©Î­Èªí¥Ü¤§
¦WºÙ               ­È         ´y­z
xlNext            1    ·j´M½d³ò¤¤ªº¤U¤@­Ó²Å¦X­È¡C
xlPrevious     2     ·j´M½d³ò¤¤ªº¤W¤@­Ó²Å¦X­È¡C

TOP

¦^´_ 12# boblovejoyce
¨S¦³«ü©ú°Ñ¼Æ¦WºÙ¡A¡A¡AÂI¥X°Ñ¼Æ¦ì¸m¡C
½Ð¬ÝVBA¤¤ Find ªº»¡©ú
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 9# lpk187

¿Ë·Rªº lpk187¤j¤j
    Set zz = Rng.Find(ar, , , , , 2)
    Set aa = Rng.Find("  (net ", Range(zz.Address), , , , 2)

§Ú·Q°Ý¤@¤U¤@­Ó·§©À ¬°¤°»ò»Ý­n³o»ò¦h ,,,,, ³r¸¹
­n¤À¹j¤°»ò?¤°»ò·N«ä
½Ð«ü¤Þµ¹¤p§Ì¤@­ÓÆ[©À?or ¦³¬ÛÃö°T®§§Ú¥hª¦¤å¬d§ä?
·PÁ§A

TOP

        ÀR«ä¦Û¦b : °ß¨ä´L­«¦Û¤vªº¤H¡A¤~§ó«i©óÁY¤p¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD