Exactly the same for your post #14 code : just well amending each double Replace statement …
Sub INVOICES_SPLIT()
Dim Data, File As String, Dict As Object, i As Long
Application.ScreenUpdating = False
Set Dict = CreateObject("scripting.dictionary")
With Sheet1
Data = .Cells(1).CurrentRegion
For i = 2 To UBound(Data)
If Not Dict.exists(Replace( Replace(Data(i, 2), vbCr, ""), vbLf, "")) Then
File = ThisWorkbook.Path & "\" & Replace( Replace(Data(i, 2), vbCr, ""), vbLf, ""): Dict.Add Replace( Replace(Data(i, 2), vbCr, ""), vbLf, ""), 1
With .Cells(1).CurrentRegion
.AutoFilter 2, Replace( Replace(Data(i, 2), vbCr, ""), vbLf, "")
.SpecialCells(12).Copy
With Workbooks.Add
.Sheets(1).Range("A1").PasteSpecial xlPasteAll
.SaveAs File & ".xlsx"
.Close False
End With
.AutoFilter
End With
End If
Next i
End With
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Bookmarks