Hi there, I have been struggling to build a macro that can do exactly this:
(http://www.mrexcel.com/forum/excel-...ications-autofilter-copy-paste-new-sheet.html)
For each new unique criteria, it creates a new worksheet with the title of that unique item. along with return all the columns A:I
Here is my recording of the first filter. Can someone please edit the macro so that it creates a new worksheet with the name of the unique item and pastes the rest of the columns. I tried to use the macro previously posted but can not get it to work.
Sub Macro4()
'
' Macro4 Macro
'
'
Cells.Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$I$31").AutoFilter Field:=2, Criteria1:= _
"Administrative Services" (Want this to be dynamic and creat a new worksheet for each unique item)
Range("A1:I6").Select
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Administrative Services"
Range("A1").Select
ActiveSheet.Paste
End Sub
Thanks in advance!
(http://www.mrexcel.com/forum/excel-...ications-autofilter-copy-paste-new-sheet.html)
For each new unique criteria, it creates a new worksheet with the title of that unique item. along with return all the columns A:I
Here is my recording of the first filter. Can someone please edit the macro so that it creates a new worksheet with the name of the unique item and pastes the rest of the columns. I tried to use the macro previously posted but can not get it to work.
Sub Macro4()
'
' Macro4 Macro
'
'
Cells.Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$I$31").AutoFilter Field:=2, Criteria1:= _
"Administrative Services" (Want this to be dynamic and creat a new worksheet for each unique item)
Range("A1:I6").Select
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Administrative Services"
Range("A1").Select
ActiveSheet.Paste
End Sub
Thanks in advance!