This is the Sheet1 and has been renamed it to s1
The VBA script below creates 2 new sheets, and name it as Task XYZ and Group JKL.
This script also filter the 2nd field (column B), and look for string specific string, let say x.
Finally it copies the first row on s1 and paste it to another new created sheets.
Current output for s1
Current output for both Task XYZ and Group JKL
But what I wanted to do now is not only copy and paste, but to cut the filtered content as well.
Desired output for s1
Desired output for Task XYZ
The VBA script below creates 2 new sheets, and name it as Task XYZ and Group JKL.
This script also filter the 2nd field (column B), and look for string specific string, let say x.
Finally it copies the first row on s1 and paste it to another new created sheets.
VBA Code:
Sub test()
' 1. Create 2 new sheets, name it as `Task XYZ` and `Group JKL`
Sheets.Add After:=ActiveSheet
ActiveSheet.Name = "Task XYZ"
Sheets.Add After:=ActiveSheet
ActiveSheet.Name = "Group JKL"
' 2. Filter 2nd field (column B), look for string "x"
Sheets("s1").Range("A1").AutoFilter Field:=2, Criteria1:="x"
' 3. Copy and paste s1 to other sheets
Sheets("s1").Rows(1).Copy
Sheets("Task XYZ").Paste
Sheets("Group JKL").Paste
End Sub
Current output for s1
Current output for both Task XYZ and Group JKL
But what I wanted to do now is not only copy and paste, but to cut the filtered content as well.
Desired output for s1
Desired output for Task XYZ