Originally Posted by
sahinbur
how can we save them to the predefined folder with the name of the country that should be the name of the workbook.[/COLOR]
Assuming each country name is a valid filename, then something like:
Sub blah()
Application.ScreenUpdating = False
Set SceRng = Range("Table2[#All]")
With Sheets.Add
.Range("A1,C1").Value = "Country"
SceRng.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=.Range("C1"), Unique:=True
Set myList = .Range("C1").CurrentRegion
For Each cll In Intersect(myList, myList.Offset(1)).Cells
.Range("A2").FormulaR1C1 = "=""=" & cll.Value & """"
Set NewSht = ThisWorkbook.Sheets.Add
SceRng.AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=.Range("A1:A2"), CopyToRange:=NewSht.Range("A1"), Unique:=False
NewSht.Columns("A:N").EntireColumn.AutoFit
'NewSht.Name = cll.Value 'optional
NewSht.Move
ActiveWorkbook.Close True, "C:\Users\Public\Documents\" & cll.Value & ".xlsx"
Next cll
Application.DisplayAlerts = False: .Delete: Application.DisplayAlerts = True
End With
Application.ScreenUpdating = True
End Sub
Of course, you should adjust "C:\Users\Public\Documents" to your predefined folder.