Macro to copy row based on condition
Closed
Rachel541
Posts
1
Registration date
Tuesday December 21, 2021
Status
Member
Last seen
December 21, 2021
-
Dec 21, 2021 at 09:22 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Dec 23, 2021 at 12:00 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Dec 23, 2021 at 12:00 PM
Related:
- Macro to insert row in excel based on criteria
- Insert gif in excel - Guide
- Insert draft watermark in word on all pages - Guide
- Excel macro to create new sheet based on value in cells - Guide
- How to insert photo in word for resume - Guide
- Number to words in excel - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Dec 23, 2021 at 12:00 PM
Dec 23, 2021 at 12:00 PM
Hi Rachel,
In the code below, Sheet 1 is called "Sheet1" and sheet 6 "Sheet6".
What would you consider a duplicate? In the code below, the value from column A needs to be unqiue for the row to be copied over.
Here is the code:
You will have to wait till next year for further assistance from me.
Best wishes and a happy new year!
Trowa
In the code below, Sheet 1 is called "Sheet1" and sheet 6 "Sheet6".
What would you consider a duplicate? In the code below, the value from column A needs to be unqiue for the row to be copied over.
Here is the code:
Sub RunMe() Dim mFind As Range Sheets("Sheet1").Select For Each cell In Range("A3:A5000") If cell.Offset(0, 44).Value = "Yes" Then Set mFind = Sheets("Sheet6").Columns("A").Find(cell.Value) If mFind Is Nothing Then cell.EntireRow.Copy Sheets("Sheet6").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) End If Next cell End Sub
You will have to wait till next year for further assistance from me.
Best wishes and a happy new year!
Trowa