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

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

¦^´_ 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

        ÀR«ä¦Û¦b : ¤H¨ÆªºÁ}Ãø»PµZ¿i¡A´N¬O¤@ºØ¦ÒÅç¡C
ªð¦^¦Cªí ¤W¤@¥DÃD