Move Row from one worksheet to another based on cell value

danjameswalker

New Member
Joined
Oct 23, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Firstly; I'm aware this has been asked loads but I just can't figure it out!

I would like to move an row from my Worksheet "Action Log" to another worksheet "Closed Actions" when an "x" is input in the Complete column of my table.

From what I understand I need to use VBA code but I've tried putting a few of the code strings in with no luck.
Each row has some formulas in and some conditional formatting. The Complete column only has conditional formatting in. I don't know if that confuses it

I have never used VBA before so could someone break it down as if youre talking to an infant :)

1603465390947.png
 
This worked perfectly! You are truly a life saver!! Thank you!! :) :) :) :)
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hello Old Friend :) I was hoping to add one more small change to the above coding. I was wondering if I can add a date/time stamp. I would like it to appear in column M on the "Received Orders" sheet once the "Received By" dropdown is clicked and the line gets moved to the "Received Orders" sheet. Let me know if you need any further information or if this is even possible.

Thanks!!
 
Upvote 0
Try:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("L:L")) Is Nothing Then Exit Sub
    If MsgBox("Are you sure you want to move row " & Target.Row & " to the 'Received Orders' sheet?", vbYesNo) = vbYes Then
        Application.EnableEvents = False
        With Sheets("Received Orders")
            Target.EntireRow.Copy .Cells(.Rows.Count, "A").End(xlUp).Offset(1)
            .Cells(.Rows.Count, "M").End(xlUp).Offset(1) = Now()
        End With
        Target.EntireRow.Delete
        Application.EnableEvents = True
    End If
End Sub
 
Upvote 0
So this worked to a point. It time stamped Row 2 on the Received Orders sheet though and the row I moved went to Row 5. Is there a way to make the time stamp match the destination line?
 
Upvote 0
So this worked to a point. It time stamped Row 2 on the Received Orders sheet though and the row I moved went to Row 5. Is there a way to make the time stamp match the destination line?
Oh, wait. I see that if all of the above cells are filled (which they will be when the sheet is live, it filled the first available which does match the destination line. Sorry. No need for revisions. Thank you!!!!
 
Upvote 0

Forum statistics

Threads
1,215,343
Messages
6,124,405
Members
449,157
Latest member
mytux

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top