title: Adding new row to the tables and fill with defined values
body: <p>I am trying to fill reports tables with specific data in the filled form, when doing so, it works well with the sheets with one table but with more table it cannot while the code is right as I think, I think there is something to do to make it do the needed well. so your kind assistance will be highly appreciated either by correcting the code or provide other way. thanks in advance</p>
  
  <pre><code>Private Sub Search_Click() ' firstly I do search
  Dim cRow As String
  On Error Resume Next
  cRow = Me.txtSearch.Value
  'find the name of the employee written on the search box in column B
  Set FindRow = Sheets("Current Payroll").Range("B:B").Find
  (what:=cRow,LookIn:=xlValues)
   If Not FindRow Is Nothing Then '&lt;-- successful find
      'add the values to the userform
  Me.txtname.Value = FindRow.Value
  Me.txtposition.Value = FindRow.Offset(0, 1).Text
  Me.Locationtxt.Value = FindRow.Offset(0, 4).Text
  End If
  End Sub
  
  
  Private Sub UpdateAdavance_Click()
  Dim the_Sheet1 As Worksheet
  Dim the_Sheet2 As Worksheet
  Dim cRow As Integer
  Dim table_list_object As ListObject
  Dim table_object_row As ListRow
  Dim x As Integer
  On Error Resume Next
  'find the row with the data on the search box
  Set FindRow = Sheets("Current Payroll").Range("B7:B").
  Find(what:=cRow, LookIn:=xlValues)
  'add the values to  deduction report table number 3
  Set the_Sheet1 = Sheets("Deduction Report")
  Set table_list_object = the_Sheet1.ListObjects(3)
  Set table_object_row = table_list_object.ListRows.Add
  table_object_row.Range(1, 1).Value = Me.txtname.Text
  table_object_row.Range(1, 2).Value = Me.txtposition.Text
  table_object_row.Range(1, 3).Value = Me.Locationtxt.Text
  table_object_row.Range(1, 4).Value = Me.txtadvance.Value
  table_object_row.Range(1, 5).Value = Format(Me.Datetxt.Value, "mmmm dd, yy")
  table_object_row.Range(1, 6).Value = Me.AdvanceReason.Text
  'add the values to  current month report table number5
  Set the_Sheet2 = Sheets("current month report ")
  Set table_list_object = the_Sheet2.ListObjects(5)
  Set table_object_row = table_list_object.ListRows.Add
  table_object_row.Range(1, 1).Value = Me.txtname.Text
  table_object_row.Range(1, 2).Value = Me.txtposition.Text
  table_object_row.Range(1, 3).Value = Me.Locationtxt.Text
  table_object_row.Range(1, 4).Value = Me.txtadvance.Value
  table_object_row.Range(1, 5).Value = Format(Me.Datetxt.Value, "mmmm dd, yy")
  table_object_row.Range(1, 6).Value = Me.AdvanceReason.Text
  End Sub
  </code></pre>