Tuesday, November 3, 2020

VBA

VBA

Sub mula()
With Sheets("s1")
.Range("A1").AutoFilter Field:=2, Criteria1:="x"
With .AutoFilter.Range
With .Range("A1").Resize(.Rows.Count, 3)
With .SpecialCells(xlCellTypeVisible).EntireRow
.Copy
With Sheets.Add(after:=Sheets(Sheets.Count))
.Name = "Task XYZ"
.Paste
.[A1].Select
End With
With Sheets.Add(after:=Sheets(Sheets.Count))
.Name = "Group JKL"
.Paste
.[A1].Select
End With
End With
End With
.Range("a1").Offset(1).Resize(.Rows.Count - 1, 3).SpecialCells(xlCellTypeVisible).EntireRow.Delete
.AutoFilter
End With
End With
End Sub


sub test
with sheets("s1").cells(1).currentregion
.autofilter 2,"x"
.copy sheets("task xyz").cells(1)
.offset(1).entirerow.delete
.autofilter
end with
end sub

No comments:

Post a Comment

Related post:

Related Posts with Thumbnails