Cut selected rows and append to different worksheet

uklobster

New Member
Joined
Dec 3, 2003
Messages
30
I hope someone can help, I did use search but couldn't quite find what I was looking for. I think what I am looking for is fairly simple, I just have no idea where to even start !!

I have a workbook with two sheets for tracking jobs. The first sheet is called 'Live' and the second sheet is called 'Complete'. Column 'A' in 'Live' has a simple 'yes / no' question, 'Is the job complete ?'. If a cell in column 'A' has 'Yes' in it is it possible to cut that row and append it to the last row in the worksheet called 'Complete' ? We mark jobs as complete in batches, so there may be multiple instances of 'Yes' in column 'A' and they may not be in a block together. It would be nice if the rows are cut and inserted into the 'Complete' sheet so that the 'Live' sheet is tidy and doesn't have empty rows of data.

I hope this makes sense and would appreciate any help :) Happy Christmas !
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
This can be done with a Worksheet_Change event macro. The way it would work is that each time you enter "Yes" in column A of 'Live', that row would be cut and copied to 'Complete'. This would be done one row at a time as you enter "Yes". Would this work for you?
 
Upvote 0
Copy and paste this macro into the worksheet code module. Do the following: right click the tab for your 'Live' sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Enter "Yes" in any cell in column A and exit the cell.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub
    Application.ScreenUpdating = False
    Application.EnableEvents = False
    On Error GoTo errHandler
    If Target = "Yes" Then
        Target.EntireRow.Copy Sheets("Complete").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
        Target.EntireRow.Delete
    End If:
errHandler:
    Application.EnableEvents = True
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,558
Latest member
aivin

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