Help with Parsing Sheets

wmtsub

Active Member
Joined
Jun 20, 2018
Messages
322
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
 

Some videos you may like

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Watch MrExcel Video

Forum statistics

Threads
1,109,126
Messages
5,526,986
Members
409,733
Latest member
revender17

This Week's Hot Topics

Top