title: VBA to copy a row to new spreadsheet when column L value matches Column P
body: <p>I run a weekly sales report and move some of the information based on the sales person name so I can then generate several reports. </p>
  
  <p>I have code to sort the sales persons names in column "L", remove duplicate names and generate a new Column, "P". It then creates new sheets and names them after the names in "P". This way if I have sales people come and go I do not have to manually modify anything.</p>
  
  <p>I currently filter the names and manually move the row data to their respective sheets. What I need is:</p>
  
  <p>1- find all names in column L that match to the "Master name Column" Cell P2 or P3 or P4 etc.</p>
  
  <p>2- copy all rows that have the name in column L to the worksheet of the same name. The worksheets names are the same as the names in Column P.</p>
  
  <p>3- move the the next name in column P, cell P3, and start the match process again. . .`    </p>
  
  <p>I have attached the code I am using to create the worksheets from the names in column P. </p>
  
  <pre><code>Dim newSheet As Worksheet, regionSheet As Worksheet
      Dim cell As Object
      Dim regionRange As String
  
      Set regionSheet = Sheets("EXPORT_QUERY")
      Application.ScreenUpdating = False
  
      regionRange = "P2:" &amp; regionSheet.Range("P2").End(xlDown).Address
  
      For Each cell In regionSheet.Range(regionRange)
         If SheetExists(cell.Value) = False Then
            Sheets.Add After:=Sheets(Sheets.Count)
            Set newSheet = ActiveSheet
            newSheet.Name = cell.Value
            Application.DisplayAlerts = False
            Application.DisplayAlerts = True
         End If
      Next cell
  
     MsgBox "All worksheets have been created successfully"
  
     Application.ScreenUpdating = True
  
  End Sub
  </code></pre>