title: Excel 2013 Overflow due to lack of VBA optimization
body: <p>I would like to export data from a consolidated sheet (DATA) to multiple sheets regarding criteria.
  I have a total of 13 criteria, each criteria has to be exported in its dedicated sheet.</p>
  
  <p>I'm trying to optimize this macro (only 2 criteria here) because it lag out</p>
  
  <pre><code>Sub copy()
  
  Application.ScreenUpdating = False
  
  Dim i As Long
  Dim j As Long
  
  Dim sh As Worksheet
  Dim feuillePrincipale As Worksheet
  Dim S01Sheet As Worksheet
  Dim S02Sheet As Worksheet
  Set feuillePrincipale = ThisWorkbook.Sheets("DATA")
  Set S01Sheet = ThisWorkbook.Sheets("S01")
  Set S02Sheet = ThisWorkbook.Sheets("S02")
  
  For Each sh In ThisWorkbook.Worksheets
  If sh.Name = "S01" Then
  i = 2
  j = 2
      While Not IsEmpty(feuillePrincipale.Cells(i, 1))
          If feuillePrincipale.Cells(i, 11).Value Like "S01*" Then
          feuillePrincipale.Cells.Rows(i).EntireRow.copy S01Sheet.Rows(j)
          j = j + 1
          End If
      i = i + 1
      Wend
   End If
  
  If sh.Name = "S02" Then
  i = 2
  j = 2
      While Not IsEmpty(feuillePrincipale.Cells(i, 1))
          If feuillePrincipale.Cells(i, 11).Value Like "S02*" Then
          feuillePrincipale.Cells.Rows(i).EntireRow.copy S02Sheet.Rows(j)
          j = j + 1
          End If
      i = i + 1
      Wend
  End If
  
  Next
  
  Application.ScreenUpdating = True
  
  End Sub
  </code></pre>
  
  <p>If you have any idea, I read I can use Advanced filter but as you guess I'm new in VBA so I'm listening any tips!</p>