title: Excel VBA Copy matching information from one worksheet to another with a loop
body: <p>I'm trying to get a macro in Excel working.</p>
  
  <p>Right now I have a worksheet called "Forms" with 3 columns - the headings (in row 1) are A = Form Number, B = Form Name, C = Parts
  I also have a worksheet called Ins, which has the same exact headings and is populated with the information already.</p>
  
  <p>I'm trying to get it so that I can enter in the form numbers on "Forms" in column A and have the information from Ins automatically copy over for columns B and C. I have EntireRow in the code right now, but I would prefer it if I could have it specifically only copy to column A to C, but I can't think of how.</p>
  
  <p>Here is the code I'm currently trying to use:</p>
  
  <pre><code>Private Sub Auto()
  
  Application.ScreenUpdating = False
  Dim wks1 As Worksheet, wks2 As Worksheet
  
  Dim j As Integer
  Dim i As Integer
  
  Set wks1 = Sheets("Forms")
  Set wks2 = Sheets("Ins")
  
  lastline = wks1.UsedRange.Rows.Count
  
  For i = 2 To lastline
  
  wks2.Cells(1, 1).CurrentRegion.AutoFilter
  wks2.Cells(1, 1).CurrentRegion.AutoFilter 1, wks1.Cells(i, 1).Value
  wks2.Cells(1, 1).CurrentRegion.EntireRow.Copy wks1.Cells(i, 1)
  wks2.Cells(1, 1).CurrentRegion.AutoFilter
  
  
  Next i
  
  
  End Sub
  </code></pre>