Find matching data in two worksheets and copy entire row
Closed
fairhope221
-
Sep 24, 2017 at 12:08 AM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Sep 25, 2017 at 08:43 AM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Sep 25, 2017 at 08:43 AM
Related:
- Find matching data in two worksheets and copy entire row
- Transfer data from one excel worksheet to another automatically - Guide
- Saints row 2 cheats - Guide
- Tmobile data check - Guide
- Display two columns in data validation list but return only one - Guide
- How to delete a row in a table in word - Guide
1 response
vcoolio
Posts
1411
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 6, 2024
262
Sep 25, 2017 at 08:43 AM
Sep 25, 2017 at 08:43 AM
Hello Fairhope221,
Try the following code in a copy of your work book first:-
I'm assuming that your data starts in row2 with headings in row1 of each sheet.
I hope that this helps.
Cheerio,
vcoolio.
Try the following code in a copy of your work book first:-
Sub FindPhoneNos() Dim lr As Long Dim sValue As Range, c As Range Application.ScreenUpdating = False Sheet3.UsedRange.Offset(1).ClearContents lr = Sheet1.Range("A" & Rows.Count).End(xlUp).Row For Each c In Sheet1.Range("Z2:Z" & lr) Set sValue = Sheet2.Columns("Z:Z").Find(c.Value) If sValue Is Nothing Then GoTo Nextc If c.Value = sValue.Value Then c.EntireRow.Copy Sheet3.Range("A" & Rows.Count).End(3)(2) End If Nextc: Next c Application.CutCopyMode = False Application.ScreenUpdating = True End Sub
I'm assuming that your data starts in row2 with headings in row1 of each sheet.
I hope that this helps.
Cheerio,
vcoolio.