Is there a way to look down column C and remove the row and paste to the bottom if a certain name appears? ie if any cell in column C has "Totals for SELF PAY", it would cut the row and place it at the bottom and keep going down the work sheet?
Sub SelfPay()
Dim Ar As Areas
Dim Rng As Range
With Columns(3)
.Replace "Totals For SELF PAY", True, xlWhole, , False, , False, False
Set Ar = .SpecialCells(xlConstants, xlLogical).Areas
.Replace True, "Totals For SELF PAY", xlWhole, , False, , False, False
End With
For Each Rng In Ar
Rng.EntireRow.Copy Range("[COLOR=#ff0000]B[/COLOR]" & Rows.Count).End(xlUp).Offset(1, -1)
Rng.EntireRow.Delete
Next Rng
End Sub
This uses col B to find the last used rows, change if needed
Sub SelfPay()
Dim Ar As Areas
Dim Rng As Range
With Columns(3)
.Replace "Totals For SELF PAY", True, xlWhole, , False, , False, False
Set Ar = .SpecialCells(xlConstants, xlLogical).Areas
.Replace True, "Totals For SELF PAY", xlWhole, , False, , False, False
End With
For Each Rng In Ar
Rng.EntireRow.Copy Range("[COLOR=#ff0000]B[/COLOR]" & Rows.Count).End(xlUp).Offset(1, -1)
Rng.EntireRow.Delete
Next Rng
End Sub
This uses col B to find the last used rows, change if needed
PS
You do not need to quote the posts all the time, it messes up the thread.
As a rough rule of thumb
If you are replying to the previous post no quote is needed
If you are replying to an older post, only quote what is needed.
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.