View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Find multiple matches in other sheet column return row data

Hi Howard,

Am Thu, 25 Jun 2015 02:27:26 -0700 (PDT) schrieb L. Howard:

https://www.dropbox.com/s/jyawocfar9...Copy.xlsm?dl=0


ignore the last answer and try it this way:

Sub Nme_Find_Exp()
Dim rngFound As Range, Nme As Range
Dim OneRng As Range, rngBig As Range
Dim FirstAddress As String

Set OneRng = Sheets("Input").Range("A2:A" & Cells(Rows.Count,
"A").End(xlUp).Row)

For Each Nme In OneRng

Set rngFound = Sheets("Output").Range("A:A").Find(What:=Nme.Value , _
LookIn:=xlValues, _
LookAt:=xlWhole)


If Not rngFound Is Nothing Then

FirstAddress = rngFound.Address
Do
Sheets("Input").Cells(Rows.Count, 3).End(xlUp)(2) _
.Resize(1, 42).Value = rngFound.Resize(1, 42).Value
Set rngFound = Sheets("Output").Range("A:A").FindNext(rngFound)
Loop While Not rngFound Is Nothing And rngFound.Address <
FirstAddress

End If
Next
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional