VBA moving rows

rolfet

New Member
Joined
Jul 22, 2024
Messages
5
Office Version
  1. 365
Platform
  1. Windows
hi all,

I am trying to get rows to move from "active" Sheet to "complete" sheet on the attached file once column "J" has been sent to "complete".

for the life of me i can not get it to work and as its a moving sheet thats updated daily i want it to move rows from one sheet to another so it only shows live jobs.

can anyone help me with the code as i tried using the below and cant get it to work?

Private Sub Worksheet_Change(ByVal Target As Range)

' Check to see only one cell updated
If Target.CountLarge > 1 Then Exit Sub

' Check to see if entry is made in column B after row 5 and is set to "Yes"
If Target.Column = 10 And Target.Row > 2 And Target.Value = "Complete" Then
Application.EnableEvents = False
' Copy columns B to I to complete sheet in next available row
Range(Cells(Target.Row, "B"), Cells(Target.Row, "K")).Copy Sheets("Complete").Cells(Rows.Count, "B").End(xlUp).Offset(1, 0)
' Delete current row after copied
Rows(Target.Row).Delete
Application.EnableEvents = True
End If

End Sub


thanks for any help in advance
 

Attachments

  • ECU Tracker.png
    ECU Tracker.png
    86 KB · Views: 29
thank you for taking the time to look at this for me. For some reason the code wont work for me. I have opened a new workbook and laid it out from B to K as above and saved it as macro enabled, copied and pasted the above code however it still doesn't work for me? is there a way you can send me your test file and i can save and re-use that one? sorry for being a pain!!
Of course. I'll send it come morning (morning for me at least).
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
that's great, thank you. Hopefully last question but i noticed this is on google drive. Would the code be different/ not work if i am using microsoft excel?
It was created in Microsoft Excel. I just placed it there, so you could access it. Download it and open it with Excel.
 
Upvote 0
rolfet,

Please Note:
In the future, when marking a post as the solution, please mark the post that contains the solution (not your own post acknowledging that some other post was the solution).
When a post is marked as the solution, it is then shown right underneath the original question so people viewing the question can easily see the question and solution in a single quick glance without having to hunt through all the posts.

I have updated this thread for you.
 
Upvote 0

Forum statistics

Threads
1,223,939
Messages
6,175,533
Members
452,652
Latest member
eduedu

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