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

vba find ¦h±ø¥ó ¨D±Ð

vba find ¦h±ø¥ó ¨D±Ð

¦w¦w! ¤j®a¦n  
§Ú·Q½Ð±Ð¦U¦ì¤j¤j  Ãö©óFINDªºVBA¤èªk

§ÚªºEXCELªí ¥ªÃ䦳¤@°ï ¼Æ¾Ú   §Æ±æ¥Î¥kªº 4¦r¶}ÀYªº¶}ÀY7­Ó¸¹½X¨Ó§ä ¥ªÃ䪺¸ê®Æ  

§Ú²{¦bªº¤èªk ¬O¥ÎCTRL+F ¨Ó¿é¤J ¥kÃä4¦r¶}ÀY ªº7­Ó¸¹½X¨Ó§ä ¥ªÃ䪺¸ê®Æ  §Æ±æ¯àÅܦ¨VBA   ¥h§â¸ê®Æ§ä¨ì ´N  ½Æ»s¤@­Ó  ¦b®ÇÃ䪺¦C  

¤ñ¦p¹Ï¤ù³o¼Ë  




ªþ¤Wªþ¥ó §Ú¹Á¸Õ¥Î¿ý»s¥¨¶°ªº¤è¦¡ «oµo²{ FIND ªº±ø¥ó ¥u¦³¤@­Ó ¥u¥i¥H¦bWHAT: ¨º¿é¤J¤@­Ó     ·Q¤£¨ì«ç»ò¤@¦¸¹L¥h³B²z     ¨D¤j¤j­Ì«ü±Ð :Q   

find.rar (2.14 KB)

¨D¤j¤j«ü±Ð  ±Ð§Ú«ç»ò¥u®³¨úxx «eªº¼Æ¦r ¦ÜªÅ®æ  ¤]¥i¥H°Ú .......

TOP

§Aªº¸ê®Æ¨S¦³³W«h¡A«ÜÃø¥ÎVBA§¹¦¨¡C

TOP

¦^´_ 2# adrian_9832
¥i¥H¥ÎSplit«ü¥O
Sub ex()
Dim x
x = Split(Sheets(1).Range("a1"), "/") 'PN/NN NUMBERING:24312(0-1)XX/4100602(0-1)XX¿é¤J¦bRange("a1")·í¥Ü½d,§Q¥Î¦r¦ê¤ºªº"/"±N¦r¦ê©î¶}
x = Split(x(2), "XX")  '§Q¥Î"XX"±N4100602(0-1)¨ú¥X
MsgBox x(0)
End Sub

TOP

¥»©«³Ì«á¥Ñ adrian_9832 ©ó 2017-11-5 19:17 ½s¿è

¦^´_ 4# jcchiang


    ¤j¤j ! ½Ð°ÝSplit(x(2)   Split(x(1)  «ç»ò¥Îªº
ÁÙ¦³MSGBOX X(0)

TOP

¦^´_ 5# adrian_9832
°}¦C§Î¦¡
PN/NN NUMBERING:24312(0-1)XX/4100602(0-1)XX
·í¥Î"/"±N¦r¦ê©î¶}
x(0)=PN
x(1)= NN NUMBERING:24312(0-1)XX
x(2)=4100602(0-1)XX
¦b±Nx(2)¥Î"XX"©î¶}
x(0)=4100602(0-1)

TOP

¦^´_ 1# adrian_9832

°Ñ¦Ò¬Ý¬Ý
³oµ{¦¡¥¼¦Ò¼{§ä´MNN¦ý¥u®t³Ì«á¤@¦rªº³¡¤À¡A·|Âл\«e­±¤w¶ñ¤J¹L
  1. Public Sub text()
  2. Dim FindRange As Range, FindString As Range
  3. lastRow = Cells(ActiveSheet.Rows.Count, 2).End(xlUp).Row
  4. Set FindRange = Worksheets(1).Range(Cells(1, 2), Cells(lastRow, 2))
  5. Set FindString = Worksheets(1).Range(Cells(9, 13), Cells(Cells(ActiveSheet.Rows.Count, 13).End(xlUp).Row, 13))

  6. For Each a In FindString
  7.     a1 = Left(a.Value, Len(a.Value) - 1)
  8.     Set c = FindRange.Find(a1, LookIn:=xlValues)
  9.    
  10.     If Not c Is Nothing Then
  11.         firstAddress = c.Address
  12.         Do
  13.             Cells(c.Row, 8).Value = Cells(a.Row, a.Column - 1).Value
  14.             Cells(c.Row, 9).Value = a.Value
  15.             Set c = FindRange.FindNext(c)
  16.         Loop While Not c Is Nothing And c.Address <> firstAddress
  17.     End If
  18. Next
  19. End Sub
½Æ»s¥N½X

TOP

¼Ó¤W¤j¤j­Ì¤w¸g¦n²r¤F    ÁÂÁ¦U¦ìªºÀ°§U

TOP

        ÀR«ä¦Û¦b : µÊ®ð¼L¤Ú¤£¦n¡A¤ß¦a¦A¦n¤]¤£¯àºâ¬O¦n¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD