How to compare two excel sheets and combine matching data
Closed
jfitz
Posts
1
Registration date
Monday August 14, 2017
Status
Member
Last seen
August 14, 2017
-
Aug 14, 2017 at 03:31 PM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Aug 15, 2017 at 12:47 AM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Aug 15, 2017 at 12:47 AM
Related:
- How to compare two excel sheets and combine matching data
- Transfer data from one excel worksheet to another automatically - Guide
- Combine notifications viber - Guide
- How to screenshot excel sheet - Guide
- How to open excel sheet in notepad++ - Guide
- Beyond compare - Download - File management
1 response
vcoolio
Posts
1411
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 6, 2024
262
Aug 15, 2017 at 12:47 AM
Aug 15, 2017 at 12:47 AM
Hello Jfitz,
Try the following code, placed in a standard module and assigned to a button:-
I hope that this helps.
Cheerio,
vcoolio.
Try the following code, placed in a standard module and assigned to a button:-
Sub FindMatch() Dim lr As Long Dim fValue As Range Dim c As Range lr = Range("A" & Rows.Count).End(xlUp).Row For Each c In Sheet1.Range("A2:A" & lr) Set fValue = Sheet2.Columns("A:A").Find(c.Value) If fValue Is Nothing Then GoTo Nextc If c.Value = fValue.Value Then c.EntireRow.Copy Sheet3.Range("A" & Rows.Count).End(3)(2) fValue.EntireRow.Copy Sheet3.Range("A" & Rows.Count).End(3)(2) End If Nextc: Next c Sheet3.Select End Sub
I hope that this helps.
Cheerio,
vcoolio.