Marking this thread as solved (even though the solution came from another forum) in case someone else can use the macro for themselves down the road:
Code credit and courtesy to 'CatDaddy' from VBAexpress forums:
Sub alex()
Application.ScreenUpdating = False
Dim cell, cell2 As Range
Dim lr, lr2, r As Long
Sheets.Add After:=Sheets(Sheets.Count)
ActiveSheet.Name = "result"
Sheets(1).Activate
lr = Range("A" & Rows.Count).End(xlUp).Row
r = 1
For Each cell In Range("A1:A" & lr)
ActiveWorkbook.Sheets(2).Activate
lr2 = Range("A" & Rows.Count).End(xlUp).Row
For Each cell2 In Range("A1:A" & lr2)
If cell2.Text = cell.Text Then
cell2.EntireRow.Copy Destination:=Sheets("result").Range("A" & r)
r = r + 1
End If
Next cell2
Next cell
Application.ScreenUpdating = True
End Sub
---------- Post added at 10:22 AM ---------- Previous post was at 10:18 AM ----------
Marking this thread as solved (even though the solution came from another forum) in case someone else can use the macro for themselves down the road:
Code credit and courtesy to 'CatDaddy' from VBAexpress forums:
Sub alex()
Application.ScreenUpdating = False
Dim cell, cell2 As Range
Dim lr, lr2, r As Long
Sheets.Add After:=Sheets(Sheets.Count)
ActiveSheet.Name = "result"
Sheets(1).Activate
lr = Range("A" & Rows.Count).End(xlUp).Row
r = 1
For Each cell In Range("A1:A" & lr)
ActiveWorkbook.Sheets(2).Activate
lr2 = Range("A" & Rows.Count).End(xlUp).Row
For Each cell2 In Range("A1:A" & lr2)
If cell2.Text = cell.Text Then
cell2.EntireRow.Copy Destination:=Sheets("result").Range("A" & r)
r = r + 1
End If
Next cell2
Next cell
Application.ScreenUpdating = True
End Sub
Bookmarks