The code below is gathering all instances of the same name and creating ne ws with them. but it always creates one extra sheet.
How can I get this tonot bake the last sheet?
Set ws = Sheets(awsn)
If ws.AutoFilterMode Then ws.AutoFilterMode = False
With CreateObject("scripting.dictionary")
For Each Cl In ws.Range("n2", ws.Range("n" & Rows.Count).End(xlUp))
If Not .Exists(Cl.Value) Then
Worksheets.Add.Name = Cl.Value
.Add Cl.Value, Nothing
ws.Range("A1:Z1").AutoFilter 14, Cl.Value ' [14] Range to combine data from
ws.AutoFilter.Range.Copy Worksheets(Cl.Value).Range("A1")
End If
Next Cl
End With
How can I get this tonot bake the last sheet?
Set ws = Sheets(awsn)
If ws.AutoFilterMode Then ws.AutoFilterMode = False
With CreateObject("scripting.dictionary")
For Each Cl In ws.Range("n2", ws.Range("n" & Rows.Count).End(xlUp))
If Not .Exists(Cl.Value) Then
Worksheets.Add.Name = Cl.Value
.Add Cl.Value, Nothing
ws.Range("A1:Z1").AutoFilter 14, Cl.Value ' [14] Range to combine data from
ws.AutoFilter.Range.Copy Worksheets(Cl.Value).Range("A1")
End If
Next Cl
End With