Move entire row to worksheet based on what is typed in NEED HELP THANK YOU!

damancurry

New Member
Joined
Apr 3, 2015
Messages
6
I am trying to move a whole row(B thru K of the row) to a different sheet when in column (B) on worksheet named Promises, you put either; PAID which would move the row to worksheet named Kept; BROKEN to worksheet named Broken; FOLLOW UP to worksheet named Followup.
On the next blank line in those worksheets either Paid, Broken or Followup. And if possible delete the moved line?

I need help I'm new at this and know Macros and don't know if that is the solution or <acronym title="vBulletin">VB</acronym>?

Here is my spreadsheet lay out below. THANK YOU.:eek:

A1BCDEFGHIJK
A2DB #DB NamePRM AmountFeeDue ByConfidenceKEPTBrokenFollow Up
A3PAID28603Hamilton Scientific$1,500.00375.008/26/20141x
A4BROKEN28603Hamilton Scientific$1,500.00375.008/26/20142x
A5FOLLOW UP28603Hamilton Scientific$1,500.00375.008/26/20143x

<tbody>
</tbody>

This doesn't work it please help:

Option Compare Text
Sub MM1()
Dim lr As Long, r As Long, lr2 As Long
lr = Cells(Rows.Count, "B").End(xlUp).Row
For r = lr To 2 Step -1
Select Case Range("B" & r).Value
Case Is = "PAID"
lr2 = Sheets("Kept").Cells(Rows.Count, "A").End(xlUp).Row
Rows(r).Copy Destination:=Sheets("Kept").Range("A" & lr2 + 1)
Case Is = "BROKEN"
lr2 = Sheets("Broken").Cells(Rows.Count, "A").End(xlUp).Row
Rows(r).Copy Destination:=Sheets("Broken").Range("A" & lr2 + 1)
Case Is = "FOLLOW UP"
lr2 = Sheets("Followup").Cells(Rows.Count, "A").End(xlUp).Row
Rows(r).Copy Destination:=Sheets("Followup").Range("A" & lr2 + 1)
End Select
Rows(r).Delete
Next r
End Sub



I uploaded to google drive account
https://drive.google.com/file/d/0B7cMUJJSgee1QmE3QU00M05vLW8/view?usp=sharing


 
Last edited:

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Try:
Code:
Sub CopyRange()
    Application.ScreenUpdating = False
    Dim LastRow As Long
    LastRow = Sheets("Sheet1").Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    Dim x As Long
    For x = LastRow To 2 Step -1
        Select Case Cells(x, 2)
            Case "PAID"
                Range("B" & x & ":K" & x).Copy Sheets("Kept").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
                Rows(x).EntireRow.Delete
            Case "BROKEN"
                Range("B" & x & ":K" & x).Copy Sheets("Broken").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
                Rows(x).EntireRow.Delete
            Case "FOLLOW UP"
                Range("B" & x & ":K" & x).Copy Sheets("Followup").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
                Rows(x).EntireRow.Delete
        End Select
    Next x
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Wen I tried it with the data you posted, it worked properly for me. Can you upload a copy of your file to a free site such as www.box.com or to Dropbox? Mark the file for sharing and you'll be given a link to the file that you can post here.
 
Upvote 0

Forum statistics

Threads
1,216,586
Messages
6,131,579
Members
449,655
Latest member
Anil K Sonawane

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