Hi,
I'm learning VBA slowly but this has me stumped!
I have a worksheet which I need to filter by Column E for every criteria listed and copy the results to a new sheet - named after the value in Column E. Then delete the data from the original sheet.
I attempted this:
I can't work out how to:
1. select the first criteria in autofilter rather than a specific value and
2. Rename the new sheet based on the value
I'm learning VBA slowly but this has me stumped!
I have a worksheet which I need to filter by Column E for every criteria listed and copy the results to a new sheet - named after the value in Column E. Then delete the data from the original sheet.
I attempted this:
Code:
Sub Chopper()
'
' Chopper Macro
'
' Keyboard Shortcut: Ctrl+Shift+Z
'
ActiveSheet.Range("$A$1:$J$660").AutoFilter Field:=5, Criteria1:= _
"??"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Sheet1"
Sheets("BUA Count").Select
ActiveWindow.SmallScroll Down:=-9
Range("A287:J421").Select
ActiveWindow.SmallScroll Down:=-15
Selection.Copy
Sheets("Sheet1").Select
ActiveSheet.Paste
Cells.Select
Cells.EntireColumn.AutoFit
Range("E31").Select
Sheets("BUA Count").Select
Application.CutCopyMode = False
Selection.ClearContents
ActiveSheet.Range("$A$1:$J$660").AutoFilter Field:=5
End Sub
I can't work out how to:
1. select the first criteria in autofilter rather than a specific value and
2. Rename the new sheet based on the value