Comparing Two Excel Sheets and copying like data to third
Closed
tyhipo
Posts
2
Registration date
Friday June 23, 2017
Status
Member
Last seen
July 11, 2017
-
Updated on Jun 24, 2017 at 08:52 AM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Jul 13, 2017 at 06:29 AM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Jul 13, 2017 at 06:29 AM
Related:
- Comparing Two Excel Sheets and copying like data to third
- Transfer data from one excel worksheet to another automatically - Guide
- Mark sheet in excel - Guide
- Number to words in excel - Guide
- Tmobile data check - Guide
- How to open excel sheet in notepad++ - Guide
3 responses
vcoolio
Posts
1411
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 6, 2024
262
Jun 24, 2017 at 08:50 AM
Jun 24, 2017 at 08:50 AM
Hello Tyhipo,
Which code did you try? Could you please post it for us to examine.
Thank you.
vcoolio.
Which code did you try? Could you please post it for us to examine.
Thank you.
vcoolio.
tyhipo
Posts
2
Registration date
Friday June 23, 2017
Status
Member
Last seen
July 11, 2017
Jul 11, 2017 at 02:40 PM
Jul 11, 2017 at 02:40 PM
Hi Vcoolio! Sorry it took me so long but here is what I used from the other answer solution.
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
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
vcoolio
Posts
1411
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 6, 2024
262
Jul 13, 2017 at 06:29 AM
Jul 13, 2017 at 06:29 AM
Hello Tyhipo,
If you only want to copy rows with unique values in Column E (Sheet2), then try the following code:-
Run the code from Sheet2.
I hope that this helps.
Cheerio,
vcoolio.
If you only want to copy rows with unique values in Column E (Sheet2), then try the following code:-
Sub TryAgain() Dim lr As Long Dim fValue As Range lr = Range("A" & Rows.Count).End(xlUp).Row For Each cell In Sheet2.Range("E2:E" & lr) Set fValue = Sheet1.Columns("A:A").Find(cell.Value) If fValue Is Nothing Then GoTo NextCell If cell.Value = fValue.Value Then cell.EntireRow.Copy Sheet3.Range("A" & Rows.Count).End(3)(2) End If NextCell: Next cell Sheet3.Select End Sub
Run the code from Sheet2.
I hope that this helps.
Cheerio,
vcoolio.