Macro needed?

ginsterman

New Member
Joined
Apr 27, 2015
Messages
2
Hello,
I have a spreadsheet with two tabs and a table in each. The first tab contains data that is added to on a regular basis, say column D is called "Complete", what i want is if a a row in the first tab has a "Y" entered in the complete column then that row is moved from the first tab to the second tab.

Is this possible?

Thanks in advance
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Copy this to the sheet code module for the sheet where the "Y" will be entered into column D. Save the file as a macro enabled workbook. The code will then execute when a "Y" is entered in cell in column D.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Application.EnableEvents = False
     If Not Intersect(Target, Columns("D")) Is Nothing Then
          If UCase(Target.Value) = "Y" Then
               Target.EntireRow.Copy Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp)(2) 'Edit sheet name
          End If
     End If
Application.EnableEvents = True
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,305
Members
452,633
Latest member
DougMo

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