Hi,
Can anyone help me with the below?
I have sheets named "Data" & "Cancelled". If i select column G as "Cancelled" in sheet "Data" the row should be moved to the sheet "Cancelled" and deleted from the "Data" sheet.
Hi,
Can anyone help me with the below?
I have sheets named "Data" & "Cancelled". If i select column G as "Cancelled" in sheet "Data" the row should be moved to the sheet "Cancelled" and deleted from the "Data" sheet.
Try this one.
Put the code in the sheet "Data" .Right click the data sheet, view code-copy and paste the code. And change the value of G and will see the result.
![]()
Private Sub Worksheet_Change(ByVal Target As Range) Application.ScreenUpdating = 0 Application.EnableEvents = 0 If Flag = True Then Exit Sub If Target.Column = 7 Then If Target.Value = "Cancelled" Then NR = Sheets("Cancelled").Cells.Find("*", , , , xlByRows, xlPrevious).Row + 1 Target.EntireRow.Copy Sheets("Cancelled").Range("A" & NR) Flag = True Target.EntireRow.Delete End If End If Application.CutCopyMode = False Flag = False Application.ScreenUpdating = 1 Application.EnableEvents = 1 End Sub
Thanks it worked.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks