See if this works.
Sub test()
Dim myDir As String, fn As String, e, x
With Application.FileDialog(msoFileDialogFolderPicker)
If .Show Then myDir = .SelectedItems(1) & "\"
End With
If myDir = "" Then Exit Sub
x = Array("EN", "FR", "ES")
For Each e In x
With Workbooks.Add
.SaveAs myDir & e & ".xls"
End With
Next
fn = Dir(myDir & "*.xls")
Do While fn <> ""
Select Case True
Case fn Like "EN.*", fn Like "FR.*", fn Like "ES.*"
Case Else
With Workbooks.Open(myDir & fn).Sheets(1).Cells(1).CurrentRegion
.Parent.AutoFilterMode = False
For Each e In Array("EN", "FR", "ES")
.AutoFilter 1, e
If Workbooks(e & ".xls").Sheets(1).Cells(1) = "" Then
.Copy Workbooks(e & ".xls").Sheets(1).Cells(1)
Else
.Offset(1).Copy Workbooks(e & ".xls").Sheets(1).Range("a" & Rows.Count).End(xlUp)(2)
End If
Next
.Parent.Parent.Close False
End With
End Select
fn = Dir
Loop
For Each e In x
Workbooks(e & ".xls").Close True
Next
End Sub
Bookmarks