Comparing Two Excel Sheets and copying like data to third sheet
Solved/Closed
coz2992
Posts
1
Registration date
Monday June 9, 2014
Status
Member
Last seen
June 9, 2014
-
Updated on Dec 19, 2018 at 05:52 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jun 18, 2019 at 12:15 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jun 18, 2019 at 12:15 PM
Hi,
I'm trying to compare two sheets in excel and have matching column data copy the entire row into a new third sheet. Ex: Compare Sheet 1 column C to Sheet 2 column E, if the numbers match, copy the entire row of matching sheet 1 column C data to a third Sheet 3.
Not sure if this is an "If, then" or "Match" function.
Any help would be appreciated
Thanks!
I'm trying to compare two sheets in excel and have matching column data copy the entire row into a new third sheet. Ex: Compare Sheet 1 column C to Sheet 2 column E, if the numbers match, copy the entire row of matching sheet 1 column C data to a third Sheet 3.
Not sure if this is an "If, then" or "Match" function.
Any help would be appreciated
Thanks!
Related:
- Compare two worksheets and paste differences to another sheet - excel vba free download
- How to compare two excel sheets - Best answers
- Vba script to compare two worksheets - Best answers
- Fc 24 free download - Download - Sports
- Milfy city download - Download - Adult games
- Microsoft store download - Download - App downloads
- Ms access free download - Download - Databases
- Fl studio 21 download - Download - Musical production
4 responses
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Updated on Dec 19, 2018 at 05:55 AM
Updated on Dec 19, 2018 at 05:55 AM
Hi,
So you want to move an entire row of column C data? Haha. I will go with the entire row, ok?
Assuming column A from sheet1 contains data, here is the code:
To implement code:
In Excel hit Alt+F11 to open Microsoft Visual Basic window. Go to Top menu Insert > Module. Now paste the code in the big white field. You can now close Microsoft Visual Basic window.
To run the code:
Back at excel hit, Alt+F8 and double-click RunMe.
Best regards!
So you want to move an entire row of column C data? Haha. I will go with the entire row, ok?
Assuming column A from sheet1 contains data, here is the code:
Sub RunMe() Dim lRow, x As Long Sheets("Sheet1").Select lRow = Range("C1").End(xlDown).Row For Each cell In Range("C2:C" & lRow) x = 2 Do If cell.Value = Sheets("Sheet2").Cells(x, "E").Value Then cell.EntireRow.Copy Sheets("Sheet3").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) End If x = x + 1 Loop Until IsEmpty(Sheets("Sheet2").Cells(x, "E")) Next End Sub
To implement code:
In Excel hit Alt+F11 to open Microsoft Visual Basic window. Go to Top menu Insert > Module. Now paste the code in the big white field. You can now close Microsoft Visual Basic window.
To run the code:
Back at excel hit, Alt+F8 and double-click RunMe.
Best regards!
Feb 3, 2015 at 07:06 PM
Feb 3, 2015 at 08:12 PM
Sub RunMe()
Dim lRow, x As Long
Sheets("Sheet1").Select
lRow = Range("C1").End(xlDown).Row
For Each cell In Range("C2:C" & lRow)
x = 2
Do
If cell.Value = Sheets("Sheet2").Cells(x, "E").Value Then
Exit For
End If
x = x + 1
Loop Until IsEmpty(Sheets("Sheet2").Cells(x, "E"))
cell.EntireRow.Copy Sheets("Sheet3").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
Next
End Sub
Feb 3, 2015 at 08:41 PM
Jun 17, 2019 at 12:58 PM
Jun 18, 2019 at 12:15 PM
Have you tried changing the reference to Sheet1, near the top of the code, into Sheet2?
Best regards,
Trowa