Hello,
I am trying to write a macro that will let me loop through an auto-filtered list (column C in example file) . I want to filter for a criteria (in this case a network), copy the filtered data, paste it onto a new workbook and save it. Although I have been able to record a macro (see below) that can do this, I have to copy and paste this macro over and over again for the other networks. I would like to know if there is a macro that can loop through each criteria in an auto-filter list, copy and save the data into new workbooks for me. I've attached a sample workbook that should be helpful in understanding what I'm trying to do. Any help is much appreciated.
Sub ATTD()
'
' ATTD Macro
'
' Keyboard Shortcut: Ctrl+Shift+A
'
ActiveSheet.Range("$B$2:$D$8").AutoFilter Field:=2, Criteria1:="A"
Columns("A:D").Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Columns("A:A").ColumnWidth = 3.14
Columns("D:D").EntireColumn.AutoFit
Range("C9").Select
Application.CutCopyMode = False
ActiveWorkbook.SaveAs Filename:= _
"\\Desktop\TEST\ATTD Network A.xls", _
FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWindow.Close
Range("B12").Select
ActiveSheet.Range("$B$2:$D$8").AutoFilter Field:=2
Range("A1").Select
End Sub
Bookmarks