In Column "A", in a existing sheet.
however, i am trying to split into sheets with a below code, getting a bug with. Please help
Sub splitdata_to_Sheets()
Dim wsAll As Worksheet
Dim wsCrit As Worksheet
Dim wsNew As Worksheet
Dim LastRow As Long
Dim LastRowCrit As Long
Dim I As Long
ActiveSheet.Name = "Master sheet"
Set wsAll = Worksheets("Master sheet") ' change All to the name of the worksheet the existing data is on
LastRow = wsAll.Range("L" & Rows.Count).End(xlUp).Row
Set wsCrit = Worksheets.Add
' column A has the criteria
wsAll.Range("A1:N" & LastRow).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=wsCrit.Range("A1"), Unique:=True
LastRowCrit = wsCrit.Range("L" & Rows.Count).End(xlUp).Row
For I = 2 To LastRowCrit
Set wsNew = Worksheets.Add
wsNew.Name = wsCrit.Range("L2")
wsAll.Rows("1:" & LastRow).AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=wsCrit.Range("L1:L2"), _
CopyToRange:=wsNew.Range("A1"), Unique:=False
wsCrit.Rows(2).Delete
Next I
End Sub