I have a macro that sorts a column, and copies and pastes data based on that sort to a new sheet within same workbook. But this task is repeated and when the macro copies it over writes the data from the first time the macro runs. below is the code from my macro the sheet i am copying from is Todo and the sheet i am copying to is completed. also i would need to be able to have the macro select a new set of data to be copied over based on the sorting as well.
Columns("A:H").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$H$39").AutoFilter Field:=5, Criteria1:="<>"
Range("A4:H7").Select
Selection.Cut
Sheets("Completed").Select
Range("A4").Select
ActiveSheet.Paste
Sheets("Todo").Select
ActiveSheet.Range("$A$1:$H$39").AutoFilter Field:=5
Columns("A:H").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$H$39").AutoFilter Field:=5, Criteria1:="<>"
Range("A4:H7").Select
Selection.Cut
Sheets("Completed").Select
Range("A4").Select
ActiveSheet.Paste
Sheets("Todo").Select
ActiveSheet.Range("$A$1:$H$39").AutoFilter Field:=5
Last edited: