Advertisement
Guest User

Untitled

a guest
Jun 21st, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     Dim partNo, fabNo As String
  2.     Dim l, r As Range
  3.     partNo = Mid(lstCustProps(1, 2), 1, 6)
  4.     fabNo = Mid(lstCustProps(5, 2), (InStr(lstCustProps(5, 2), "@") + 1), 6)
  5.    
  6.     With Sheet1.Range("E2:E56")
  7.    
  8.         Set l = .Find(what:=partNo, LookAt:=xlWhole, LookIn:=xlValues)
  9.  
  10.         If l.Offset(, -2) <> fabNo Then
  11.        
  12.             Do
  13.        
  14.             Set l = .FindNext(l)
  15.  
  16.             MsgBox l.Offset(, -2) & " - " & l
  17.            
  18.             Loop While l.Offset(, -2) <> fabNo
  19.            
  20.         Else
  21.                
  22.             MsgBox "Whoever coded this wasn't too bright."
  23.                
  24.         End If
  25.        
  26.         Sheet1.Cells(l.Row, "K").Value = lstCustProps(2, 2)
  27.         Sheet1.Cells(l.Row, "L").Value = lstCustProps(3, 2)
  28.         Sheet1.Cells(l.Row, "M").Value = lstCustProps(4, 2)
  29.  
  30.     End With
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement