title: Adding criteria to VBA copy and paste
body: <p>I have the following code that works but I need to add another criteria to it.  The criteria I need to add is a wildcard search for <strong><code>*Utilities</code></strong>.  So if column L has the word <strong><code>utilities</code></strong>, then include the row in the copy and paste.  If not, do not copy and paste.  </p>
  
  <pre><code>Sub CopyData()
  
  Dim Cl As Range
  Dim SrcWbk As Workbook
  Dim SrcSht As Worksheet
  Dim DestSht As Worksheet
  Dim Rng As Range
  
  Application.ScreenUpdating = False
  
  Set SrcWbk = Workbooks.Open("Transactional Activity PD 10-2017 (Expense 
  Accounts).xlsb")
  Set SrcSht = SrcWbk.Sheets("Activity")
  Set DestSht = ThisWorkbook.Sheets("Transactions")
  
  With CreateObject("scripting.dictionary")
      For Each Cl In DestSht.Range("AE2", DestSht.Range("AE" &amp; 
  Rows.Count).End(xlUp))
          If Not .exists(Cl.Value) Then .Add Cl.Value, Nothing
      Next Cl
      For Each Cl In SrcSht.Range("AE2", SrcSht.Range("AE" &amp; 
  Rows.Count).End(xlUp))
          If Not .exists(Cl.Value) And Cl.Offset(, -29).Value = "PV" And 
  Cl.Offset(, -15) Like "*Utilities" Then
              If Rng Is Nothing Then
                  Set Rng = Cl
              Else
                  Set Rng = Union(Rng, Cl)
              End If
          End If
      Next Cl
  End With
  Rng.EntireRow.Copy DestSht.Range("A" &amp; Rows.Count).End(xlUp).Offset(1)
  
  End Sub
  </code></pre>
  
  <p>THANKS!</p>