Copy the entire row depending on a cell value but delete row if the cell value is changed/deleted

abckumar

New Member
Joined
Apr 22, 2014
Messages
5
Dear Experts,

I found a macro from your forum which copies the entire row based on a cell value ("y") -Courtesy Mr. jindon MrExcel MVP. If we type "y" in column D, the entire row is copied & pasted to sheet 2. The code is as follows. The only point for clarification is how will the code change if :-
1) the copied row should be deleted if the cell value is changed / deleted - something like an auto refresh.
2) Also, how can we copy & paste it to a specific sheet in another existing workbook located in another folder.
Forgive me, I am a civil engineer who is just starting to like vb & trying to employ it in my works.

Thanking you,
abckumar


Private Sub Worksheet_Change(ByVal Target As Range)Dim myColumn As StringmyColumn = "D" '<- change hereIf Intersect(Target, Columns(myColumn)) Is Nothing Then Exit SubIf Target.Value <> "y" Then Exit SubTarget.EntireRow.Copy Sheets("sheet2").Range("a" & Rows.Count).End(xlUp)(2)Application.CutCopyMode = FalseEnd Sub</pre>
 

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