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
Related:
- Compare two worksheets and paste differences to another sheet - excel vba free download
- Vba code to compare two excel sheets and copy differences - Best answers
- How to compare two excel sheets - Best answers
- Kmspico free download - Download - Other
- Gta 5 download apk pc - Download - Action and adventure
- Fc 24 free download - Download - Sports
- Minecraft bedrock free download pc - Download - Sandbox
- Minecraft java edition free download - Download - Sandbox
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