Moving entire row to another tab based on cell value

TreydMark

New Member
Joined
May 9, 2022
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
I have 2 tabs, essentially one is an active tab and the other is an archive. I want to moved row from active to archive tab when column G is not blank (meaning this is completed)
 

Attachments

  • xcel 1.PNG
    xcel 1.PNG
    76.7 KB · Views: 7
  • xcel 2.PNG
    xcel 2.PNG
    92.4 KB · Views: 7

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Specifics are always important.
You need to give sheet names.
You said:

I want to moved row from active to archive tab when column G is not blank (meaning this is completed)

Is the sheet actually named "archive"?

So anytime you enter any value in any cell in column G you want this row moved to sheet named "archive"
And delete this row from original sheet is that correct? If not give more specific details

Trying to get specific details from looking at an image cannot always be best way to get specific details
 
Upvote 0
If the answers to my question are true try this:
If sheet name is not correct modify my script
This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window

The script runs when you enter any value into column G
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  5/9/2022  6:12:41 PM  EDT
If Target.Column = 7 Then
Application.EnableEvents = False
Dim Lastrow As Long
Lastrow = Sheets("Archive").Cells(Rows.Count, "G").End(xlUp).Row + 1
Rows(Target.Row).Copy Sheets("Archive").Rows(Lastrow)
Rows(Target.Row).Delete
Application.EnableEvents = True

End If
End Sub
 
Upvote 0
Solution
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: How to move entire row to another tab based on cell value
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
If the answers to my question are true try this:
If sheet name is not correct modify my script
This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window

The script runs when you enter any value into column G
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  5/9/2022  6:12:41 PM  EDT
If Target.Column = 7 Then
Application.EnableEvents = False
Dim Lastrow As Long
Lastrow = Sheets("Archive").Cells(Rows.Count, "G").End(xlUp).Row + 1
Rows(Target.Row).Copy Sheets("Archive").Rows(Lastrow)
Rows(Target.Row).Delete
Application.EnableEvents = True

End If
End Sub
This worked perfectly, Thank you
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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