Hey everyone,
I've been using the following code:
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 17 Then If Target = "YES" Then Application.EnableEvents = False nxtRow = Sheets("Closed Orders").Range("Q" & Rows.Count).End(xlUp).Row + 1 Target.EntireRow.Copy _ Destination:=Sheets("Closed Orders").Range("A" & nxtRow) Target.EntireRow.Delete End If End If Application.EnableEvents = True End Sub
This works great but it relocates the entire row across all exisiting cells. I only need to relocate a certain range of columns along that row. Can the code posted above be rewritten to specify that range? Let me know if attaching a dummy workbook would explain better. Thank you all in advance for your help.
Last edited by livinglegend629; 01-17-2012 at 02:08 PM.
Yes, please attach your dummy file.
Cheers,
Arlette
If I helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
Thanks for loooking arlu.
Dummy book added. The code i have above relocates entire row if column Q is marked YES, but it moves the entire row, I'm looking to just move everything that is in the yellow and green areas.
Use this -Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 17 Then If Target = "YES" Then Application.EnableEvents = False nxtRow = Sheets("Closed Orders").Range("Q" & Rows.Count).End(xlUp).Row + 1 range("C" & target.row & ":V" & target.row).Copy _ Destination:=Sheets("Closed Orders").Range("A" & nxtRow) range("C" & target.row & ":V" & target.row).Delete End If End If Application.EnableEvents = True End Sub
Cheers,
Arlette
If I helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks