computing
  • 2

Move Row To Another Worksheet If Yes

  • 2

Can anyone help me write a Marco code that will move a row in excel to another worksheet if “Yes” is entered into colomn “I”?
I have two sheets “Current” and “Completed”. I want a row to automatically move from the current list to the completed worksheet when I select “Yes” from a drop down list in colomn “I”. The rows remaining are to move up so there are no empty rows.
Both sheets are identical. Row 1 has my headings.
Colomns A – J are in use holding various info. Its only coloum I that I was to be the trigger.

Any response will be appreciated.

Leo

Share

1 Answer

  1. Right Click the sheet tab for the sheet where you will be entering Yes.
    Choose View Code.
    Paste this code into the pane that opens:

    Private Sub Worksheet_Change(ByVal Target As Range)
     If Target.Column = 9 Then
      If Target = "Yes" Then
        Application.EnableEvents = False
          nxtRow = Sheets("Completed").Range("I" & Rows.Count).End(xlUp).Row + 1
           Target.EntireRow.Copy _
            Destination:=Sheets("Completed").Range("A" & nxtRow)
           Target.EntireRow.Delete
      End If
     End If
     Application.EnableEvents = True
    End Sub

    Click Here Before Posting Data or VBA Code —> How To Post Data or Code.

    • 0