slayer1957
Board Regular
- Joined
- Jan 9, 2017
- Messages
- 50
Good day,
I have code,
-----------------------------------------------
With this code on the current sheet it checks the value of cell F in the row, if it is "Yes" it moves the entire row to sheet "Completed" and delete the row on the source sheet. I want to expand the code, when cell F in the row has "Parking Bay" it must move entire row to sheet "Parking Bay". Both the Yes and Parking Bay must work.
Please assist to change
I have code,
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Version 2
If Not Intersect(Target, Range("F:F")) Is Nothing Then
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
Dim Lastrow As Long
Lastrow = Sheets("Completed").Cells(Rows.Count, "F").End(xlUp).Row + 1
If Target.Value = "Yes" Then
Rows(Target.Row).Copy Destination:=Sheets("Completed").Rows(Lastrow)
Rows(Target.Row).Delete
End If
End If
End Sub
-----------------------------------------------
With this code on the current sheet it checks the value of cell F in the row, if it is "Yes" it moves the entire row to sheet "Completed" and delete the row on the source sheet. I want to expand the code, when cell F in the row has "Parking Bay" it must move entire row to sheet "Parking Bay". Both the Yes and Parking Bay must work.
Please assist to change