title: Loop through table and extract certain values
body: <p>I have a table with project details and their expiration dates. If the project is expired, it outputs it to another sheet.</p>
  
  <p>I'm trying to make a Refresh button on the Expired project sheet that would loop through that table and extract all of the expired projects. </p>
  
  <pre><code>Sub refresh_expired()
      Dim wsMaster As Worksheet: Set wsMaster = Worksheets("MASTER")
      Dim wsList As Worksheet: Set wsList = Worksheets("LIST")
  
      Dim tblList As ListObject: Set tblList = wsList.ListObjects("digsafe_list")
      Dim tblExp As ListObject: Set tblExp = wsMaster.ListObjects("expired_list")
      Dim tblList_row As ListRow
      Dim tblExp_row As ListRow
  
      Dim not_empty As String
      Dim temp_digsafe As String, temp_work As String
      Dim temp_date As Date
      Dim tRows As Long, tCols As Long
  
      If tblList.DataBodyRange.Rows.count &lt;&gt; 0 Then
          Set tblExp_row = tblExp.ListRows.Add
          Set tblList_row = tblList.ListRows.Add
  
          For i = 1 To tblList.DataBodyRange.Rows.count
              If tblList_row.Range(7, i).Value &lt; 1 Then
                  temp_digsafe = tblList_row.Range(1, 1).Value
                  tblExp_row.Range(1, i).Value = temp_digsafe
  
                  temp_date = tblList_row.Range(7, i).Value
                  tblExp_row.Range(1, 4).Value = temp_date
                  i = i + 1
              End If
          Next
     End If
  End Sub
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Ee9l8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ee9l8.png" alt=""></a></p>