title: Searching Between 2 Sheets for Matches and Adding New Row If No Match Found
body: <p>For this scenario I have a "Database" Spreadsheet with a SubSheet that feeds off the "Database". Currently I have a VBA script written to check the Database sheet for matches of a certain cell in each row of the sheet. If a match is found that row from the SubSheet is copied over that row on the Database sheet. </p>
  
  <p>What I want added is another condition that if no Match is found for the row on the SubSheet currently targeted then that row is added to the bottom of the Database sheet.</p>
  
  <p>I have tried adding:</p>
  
  <p><code>ws2.Rows(ws2Row).EntireRow.Value = ws1.Rows(ws1LastRow + 1).EntireRow.Value</code> </p>
  
  <p>after my search loop but that doesn't quite work and I am not sure why. </p>
  
  <pre><code>Sub Update_Master()
  
  Dim wb1 As Workbook, wb2 As Workbook
  Dim ws1 As Worksheet, ws2 As Worksheet
  Dim ws1LastRow As Long, ws2LastRow As Long
  Dim ws1Row As Long, ws2Row As Long
  
  Application.ScreenUpdating = False
  
  Set wb1 = ThisWorkbook
  Set ws1 = wb1.Worksheets("Sheet1")
  
  Set wb2 = Application.Workbooks.Add("C:\Users\MyFolder\Desktop\Excel Master Test\ROLE BASED TRACKER DRAFT.xlsx")
  Set ws2 = wb2.Worksheets("Database")
  
  ws1LastRow = ws1.Cells(Rows.Count, "A").End(xlUp).Row
  ws2LastRow = ws2.Cells(Rows.Count, "A").End(xlUp).Row
  
  For ws1Row = 2 To ws1LastRow
      ws1.AutoFilterMode = False
      If ws1.Cells(ws1Row, 4).Value &gt; 0 Then
  
          For ws2Row = 2 To ws2LastRow
              ws2.AutoFilterMode = False
              If ws2.Cells(ws2Row, 4).Value = ws1.Cells(ws1Row, 4).Value Then
                  ws2.Rows(ws2Row).EntireRow.Value = ws1.Rows(ws1Row).EntireRow.Value
              End If
  
          Next ws2Row
  
      End If
  
  Next ws1Row
  
  ws2.Rows(ws2Row).EntireRow.Value = ws1.Rows(ws1LastRow + 1).EntireRow.Value
  
  End Sub
  </code></pre>