Comparing two excel sheets
Closed
ExcelNewbie192
Posts
1
Registration date
Sunday June 7, 2015
Status
Member
Last seen
June 7, 2015
-
Jun 7, 2015 at 08:55 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jun 9, 2015 at 11:58 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jun 9, 2015 at 11:58 AM
Related:
- Comparing two excel sheets
- Mark sheet in excel - Guide
- Sheets right to left - Guide
- How to open excel sheet in notepad++ - Guide
- Number to words in excel - Guide
- Excel apk for pc - Download - Spreadsheets
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Jun 9, 2015 at 11:58 AM
Jun 9, 2015 at 11:58 AM
Hi ExcelNewbie,
Try the code below but don't forget to adjust the sheet references (sheet1 on line 5 , sheet2 on line 10 and sheet3 on line 13) to match yours:
Let me know how it goes.
Best regards,
Trowa
Try the code below but don't forget to adjust the sheet references (sheet1 on line 5 , sheet2 on line 10 and sheet3 on line 13) to match yours:
Sub RunMe() Dim lRow As Integer Dim fValue As Range Sheets("Sheet1").Select lRow = Range("A1").End(xlDown).Row For Each cell In Range("A2:A" & lRow) Set fValue = Sheets("Sheet2").Columns("A:A").Find(cell.Value) If fValue Is Nothing Then GoTo NextCell If cell.Offset(0, 1).Value = fValue.Offset(0, 1).Value Then Range(cell, cell.Offset(0, 1)).Copy Sheets("Sheet3").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) End If NextCell: Next cell End Sub
Let me know how it goes.
Best regards,
Trowa