Move Table Row to Another Sheet

jessebh2003

Board Regular
Joined
Feb 28, 2020
Messages
71
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm working on a table and need to automatically move a row to another table on another sheet.

Book1
ABCDEFGIJKL
1EFGHRev 1_0
2Project Impact Tool (Six Sigma Tool)From 1 to 5 1 = Low; 3 = Medium; 5 = High
3Proj. ID:Project TitleWhat problem are we trying to solve? What is the business impact we are targeting?Project Scale Ease (Effort) of ImplementationQuality ImpactRisksRank / PriorityCompleteLBC Assigned toDue Date
41De-escalationReduce seclusion hours, staff assults, and restraint usage 55551Christinaongoing
52PMHOrient associates to the new PMH, align workflows with multiple departments, assess learning needs of associates working at the new PMH. 55551Kathy12/31/2023
63NAO redesignImprove Culture and retention55433Kristin 1/28/2022 ongoing
Sheet1
Cell Formulas
RangeFormula
I4:I6I4=IF(H4=" "," ",RANK(H4,PriorityNumbers1))
A4A4=ROW(A1)
A5:A6A5=$A4+1
Named Ranges
NameRefers ToCells
PriorityNumbers1=Sheet1!$H$4:$H$63I4:I6
Cells with Data Validation
CellAllowCriteria
D3Any value
E3Any value
F3Any value
G3Any value
D4List1,2,3,4,5
E4:G4List1,2,3,4,5
D5:G6List1,2,3,4,5
J1:J3Any value
J4:J6ListY,N
I3Any value


I found a similar post on here (Automatically Move Row to Another Sheet Based On Cell Value) and updated the code that @Joe4 provided to match my table; however, the row isn't being pasted into the other table.

VBA Code:
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 J after row 4 and is set to "Y"
    If Target.Column = 10 And Target.Row > 4 And Target.Value = "Y" Then
        Application.EnableEvents = False
'       Copy columns A to L to complete sheet in next available row
        Range(Cells(Target.Row, "A"), Cells(Target.Row, "L")).Copy Sheets("Completed Prioritization Tool").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
'       Delete current row after copied
        Rows(Target.Row).Delete
        Application.EnableEvents = True
    End If
    
End Sub

My data is in Table1 on sheet Example Prioritization Tool and I want to move it to Table 2 on sheet Completed Prioritization Tool. Appreciate any guidance. Thanks!
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
@psgoldberg, I made that change and the row disappears without being pasted onto the Completed sheet. Any ideas? @My Aswer Is This - I saw your solution on Move a row to another sheet based on data manually changed - Help - on the verge of tears and thought you may be able to weigh in. Appreciate any insight. Thanks.

VBA Code:
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 J after row 4 and is set to "Y"
    If Target.Column = 10 And Target.Row > 3 And Target.Value = "Y" Then
        Application.EnableEvents = False
'       Copy columns A to L to Completed sheet in next available row
        Range(Cells(Target.Row, "A"), Cells(Target.Row, "L")).Copy Sheets("Completed").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
'       Delete current row after copied
        Rows(Target.Row).Delete
        Application.EnableEvents = True
    End If
    
End Sub
 
Upvote 0
I copied your data into a new workbook, named the range, created a worksheet named <<Completed Prioritization Tool>> and put in a value in column H and the macro worked in that a row was copied to the new sheet and the row deleted from Sheet1. Is the workbook named correctly? Is there anything in Column A below where you are looking? Did you step through the macro to see that all commands are issued?

Post the sheet on Dropbox and we can take a look.
 
Upvote 0
I posted the forementioned post in Post #4

But my post had nothing to do with A Table

You said in Post 1:
I'm working on a table and need to automatically move a row to another table on another sheet.

Are you sure you're working with an Excel Table

If you're wanting to work with a sheet change event script like mine in Post 4
Please give me specific details about what you're attempting to achieve
And how do you want the script activated
 
Upvote 0
Thanks so much for your help. It's working now. Appreciate your assistance.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,636
Latest member
laura12345

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