Post your code.
The code here fulfills a similar request to yours and shows how to loop through distinct 'names', filtering the sheet by each name and saving the visible rows to a new workbook on the Desktop. It should be easily adaptable to your request.
Good morning! I have searched the Excel forum and either I am very poor at search criteria or no one but me has ever needed help with copying data based upon criteria and putting into a new workbook. I know that I can use the macro feature and do this, I actually did it with one of the names...
www.mrexcel.com
Below my Code:
Sub Split_Branch()
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.AutoFilter
Sheets("Branch_List").Select
Range("B2").Select
ActiveCell.FormulaR1C1 = "AMALNER SME"
Sheets("All Products Due List").Select
Range("B1").Select
ActiveSheet.Range("$A$1:$AL$500000").AutoFilter Field:=2, Criteria1:= _
"AMALNER SME"
Selection.End(xlToLeft).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.Columns.AutoFit
Range("A2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "1"
Range("A3").Select
ActiveCell.FormulaR1C1 = "=R[-1]C+1"
Range("A3").Select
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("B2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "AMALNER SME"
Range("A1").Select
ChDir "C:\Users\hp\Desktop\@Split Branch"
ActiveWorkbook.SaveAs Filename:= _
"C:\Users\hp\Desktop\@Split Branch\AMALNER SME.xlsx", FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
ActiveWindow.Close
End Sub