Cut a row from one sheet and paste it into another based on a specific criteria

Teuchter

New Member
Joined
Apr 11, 2015
Messages
2
Help needed please.

I do not have a clue where to start. If in doubt ask an expert.

I have a spreadsheet (2010) which 2 sheets, named: Learners and Completed. I want to delete the content of a row from the "Learners" sheet when column T (starting at T2) contains the word "completed" and paste the entire row into the second worksheet named "Completed" starting at A2 and sequential there after. I would also like the VB to delete the empty row in the first worksheet one this has been done.

If possible I would like this to happen automatically if not by the click of a command button.

Your help would be greatly appreciated.

Thank you in advance

Teuchter
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
try below code

Code:
Sub Test()
Dim i As Integer
Dim j As Integer
Sheets("Learners").Select
For i = 2 To Cells(Rows.Count, 20).End(xlUp).Row
    If UCase(Cells(i, 20).Value) = "COMPLETED" Then
        Rows(i).EntireRow.Copy Sheets("Completed").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
    End If
Next
For j = Cells(Rows.Count, 20).End(xlUp).Row To 2 Step -1
    If UCase(Cells(j, 20).Value) = "COMPLETED" Then
        Rows(j).EntireRow.Delete
    End If
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,805
Messages
6,121,664
Members
449,045
Latest member
Marcus05

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