Private Sub EditPricing_Activate()
Dim FindCell As Range
Dim LastCell As Range
Dim FoundCell As Range
Dim TargetSheet As Worksheet
Set TargetSheet = ThisWorkbook.ActiveSheet
With Worksheets("IngredientLists")
Set LastCell = .Range("B1").End(xlDown)
Set FindCell = .Range("B1", LastCell).find(TargetSheet.Cells(0, -6).Value, _
.Range("B1"), xlValues, xlWhole)
End With
If Not FindCell Is Nothing Then
Set FoundCell = FindCell
Me.txt_PurUnitMz.SetFocus
Me.txt_PurUnitMz.Value = FoundCell.Offset(0, 1)
Me.txt_PurUnitWT.Value = FoundCell.Offset(0, 8)
Me.txt_PurUnitCost.Value = FoundCell.Offset(0, 9)
Me.txt_ConvOrg.Value = FoundCell.Offset(0, 11)
Me.lbl_LastUpdate = FoundCell.Offset(0, 10)
End If
End Sub
Bookmarks