Sub TachFile()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim Dic As Object
Set Dic = CreateObject("Scripting.Dictionary")
Dim rng As Range, i As Long, lr As Long, path As String, tmp(), sh As Worksheet, r As Long
Set sh = ThisWorkbook.Sheets(1)
path = ThisWorkbook.path & "\"
lr = sh.Range("N65000").End(3).Row
Set rng = sh.Range("N5:N" & lr)
tmp = rng.Value
On Error Resume Next
For i = 1 To UBound(tmp)
If tmp(i, 1) <> "" And Not Dic.Exists(tmp(i, 1)) Then
sh.Copy
With ActiveWorkbook
For r = lr To 5 Step -1
If .Sheets(1).Range("N" & r).Value <> tmp(i, 1) Then .Sheets(1).Rows(r).Delete
Next r
.Sheets(1).Shapes(1).Delete
.SaveAs Filename:=path & tmp(i, 1) & ".xls", FileFormat:=xlExcel8
.Close
End With
End If
Next i
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub