title: Split a Master Spreadsheet into Multiple Sheets in Excel with VBA
body: <p>Here is the code I got from this helpful YouTube video:</p>
  
  <p><a href="https://www.youtube.com/watch?v=5bOFNsdHiPk" rel="nofollow noreferrer">https://www.youtube.com/watch?v=5bOFNsdHiPk</a></p>
  
  <pre><code>Sub SplitandFilterSheet()
  
  Dim Splitcode As Range
  Sheets("Master").Select
  Set Splitcode = Range("SplitCode")
  
  For Each cell In Splitcode
  Sheets("Master").Copy After:=Worksheets(Sheets.Count)
  ActiveSheet.Name = cell.Value
  
  With ActiveWorkbook.Sheets(cell.Value).Range("MasterData")
  .AutoFilter Field:=4, Criteria1:="NOT EQUAL TO" &amp; cell.Value, Operator:=xlFilterValues
  .Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
  End With
  
  ActiveSheet.AutoFilter.ShowAllData
  Next cell
  End Sub
  </code></pre>
  
  <p>PROBLEM: </p>
  
  <p>This almost works for me. It splits the Master Data into multiple tabs. The tabs are named correctly with unique employee ID's. But the content of each tab includes ALL data. It splits the unique column values correctly to 1331 1147 1498, but all three sheets have all three id's (1331, 1147, 14798)...its not deleting the ones I don't need in the tab...why? Please help:)</p>