title: Match in two different sheet and offset
body: <p>I am writing the following code that finds a match from one worksheet (Sheet2) and pastes values into (sheet2).</p>
  
  <p>So far the code targets those names that have "accepted" as offset values. it loops through looking for a match and displaying it. However i would like to also select the offset values and paste them in sheet1 if possible. THis is where I am getting confused please help, where to take my code from here?</p>
  
  <p>Sheet1 </p>
  
  <p>Column a    ,   b</p>
  
  <pre><code>5 Jim Accepted
  
  6 Bob Rejected
  
  7 Tim Accepted
  </code></pre>
  
  <p>Sheet 2</p>
  
  <p>Column d       e         f     g</p>
  
  <pre><code>  Jim      40              0.4
    Bob      78              58
    Tim      36              45  
  
  
  Sub check()
  Dim i As Long, lastrow As Long, myval As Long
  Dim agentname As String
  Dim sh2 As Worksheet
  Dim val As String
  Dim findstr As String
  Dim rng As Range
  
  Set sh2 = Sheets(2)
  
  lastrow = Cells(Rows.Count, "A").End(xlUp).Row
  For i = 1 To lastrow
  agentname = Cells(i, 1).Offset(, 1).Value
  If Cells(i, 1) = "Accepted" And Not IsEmpty(Cells(i, 1)) Then
      'For i = 1 To sh2.Range("b2:b9")
  
  myval = Application.WorksheetFunction.Match(agentname, sh2.Range("b1:b9"), 0)
  findstr = agentname
  
  MsgBox agentname
  
  End If
  Next i
  
  End Sub
  </code></pre>