Hi..
Try this.. Click on the button in the attached file.
Enter your Recipe codes from B3 down in the Results sheet..
Any Recipe code that can't be found is displayed in a Msgbox at the end along with the cell it is located at..
Private Sub CommandButton1_Click()
Dim RecArray, fVal As Range, i As Long, nf As String
RecArray = Application.Transpose(Range("B3:B" & Range("B" & Rows.Count).End(xlUp).Row))
With Sheets("Total Recipe")
For i = LBound(RecArray) To UBound(RecArray)
Set fVal = .Columns(1).Find(RecArray(i))
If Not fVal Is Nothing Then
fVal.CurrentRegion.Resize(fVal.CurrentRegion.Rows.Count + 3).Copy
Sheets("Results").Range("G" & Range("H" & Rows.Count).End(xlUp).Row).Offset(2).PasteSpecial Paste:=xlPasteAll
Else
nf = nf & "B" & i + 2 & "-" & RecArray(i) & " "
End If
Next i
If nf <> "" Then MsgBox "The Following Recipes were NOT FOUND:" & vbLf & vbLf & Join(Split(nf, " "), vbLf)
End With
Sheets("Results").Columns.AutoFit
End Sub
Bookmarks