Someone posted this VBA code and I love it, however I need to move AND delete. Can anyone help me?
Thanks!
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified 2/21/2020 9:01:00 AM EST
If Target.Column = 5 Then
If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
Dim Lastrow As Long
Dim SheetName As String
SheetName = "Completed Task"
Dim SearchValue As String
SearchValue = "Completed"
If Target.Value = SearchValue Then
Lastrow = Sheets(SheetName).Cells(Rows.Count, 5).End(xlUp).Row + 1
Rows(Target.Row).Copy Sheets(SheetName).Rows(Lastrow)
End If
End If
End Sub
Thanks!
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified 2/21/2020 9:01:00 AM EST
If Target.Column = 5 Then
If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
Dim Lastrow As Long
Dim SheetName As String
SheetName = "Completed Task"
Dim SearchValue As String
SearchValue = "Completed"
If Target.Value = SearchValue Then
Lastrow = Sheets(SheetName).Cells(Rows.Count, 5).End(xlUp).Row + 1
Rows(Target.Row).Copy Sheets(SheetName).Rows(Lastrow)
End If
End If
End Sub