VBA Copy Rows to another worksheet

Nonprof

New Member
Joined
Jul 23, 2017
Messages
8
Hello friends,

I have been working on this code, but am having trouble finishing it up.
It works well now, but I still need a few things.

1. I want the code to run automatically whenever column N has is edited on the source sheet "all positions".
2. This is to include addition OR deletion of numbers to cells in the "N" (N2 down, as I have headers) column.
3. I want it to automatically overwrite all data on the "open positions" tab each time.
4. As more than one position may be available for each row, I want the code to be modified so that it will copy the rows to the other tab when "ANY" number is entered into cells in the "N" column.

Code:
Sub Copyx()Dim RngColF As Range
Dim i As Range
Dim Dest As Range
Sheets("all positions").Select
Set RngColF = Range("N2", Range("N" & Rows.Count).End(xlUp))
With Sheets("positions open")
Set Dest = .Range("A2")
End With
For Each i In RngColF
If i.Value = "1" Then
i.EntireRow.Copy Dest
Set Dest = Dest.Offset(1)
End If
Next i
End Sub
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,214,833
Messages
6,121,858
Members
449,052
Latest member
Fuddy_Duddy

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