Hi MBCMDR
If I understood your issue, I believe the following code does what you wish.
Option Explicit
Sub FillRFQ()
Dim WKb1 As Workbook, WKb2 As Workbook, wsWKb1 As Worksheet, wsWKb2 As Worksheet
Dim FindStuff As String
Dim rng1 As Range
Dim LR As Long
Dim fRow As Range
Application.ScreenUpdating = False
'replace next four lines with your open workbook designations
Set WKb1 = Workbooks("RFQ LIST.xls")
Set WKb2 = Workbooks("Inventory.xls")
Set wsWKb1 = WKb1.Sheets("Inventory")
Set wsWKb2 = WKb2.Sheets("Inventory")
LR = wsWKb1.Range("A" & Rows.Count).End(xlUp).Row
For Each fRow In wsWKb1.Range("A2:A" & LR)
FindStuff = fRow.Value
If Trim(FindStuff) <> "" Then
With wsWKb2.Range("A:A")
Set rng1 = .Find(What:=FindStuff, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng1 Is Nothing Then
fRow.Offset(0, 1) = rng1.Offset(0, 1)
fRow.Offset(0, 2) = rng1.Offset(0, 6)
fRow.Offset(0, 3) = rng1.Offset(0, 5)
fRow.Offset(0, 4) = rng1.Offset(0, 7)
Else
End If
End With
End If
Next
Application.ScreenUpdating = True
End Sub
The code is in the attached workbook RFQ LIST and runs from a button. The file names are hard coded and assumes both are open but that's easily changed. Let me know if you have any issues.
John
Bookmarks