F
Faye
How do I accomplish the following:
1. I would like to add a line of description to the Destination
worksheet (such as "Comparison Results") in the Worksheets("Unique");
2. I would like to color the lines found in Sheet1 before they are
copied to Worksheets("Unique");
-----------------------------------------
With Worksheets("Sheet1")
Set rng1 = .Range(.Cells(1, 1), .Cells(Rows.Count, 1).End(xlUp))
End With
With Worksheets("Sheet2")
Set rng2 = .Range(.Cells(1, 1), .Cells(Rows.Count, 1).End(xlUp))
End With
For Each cell In rng1
res = Application.Match(cell, rng2, 0)
If Not IsError(res) Then
Set rng3 = rng2(res)
Set rng4 = Worksheets("Match").Cells(Rows.Count,
1).End(xlUp)(2)
cell.EntireRow.Copy Destination:=rng4
Else
Set rng4 = Worksheets("Unique").Cells(Rows.Count,
1).End(xlUp)(2)
cell.EntireRow.Copy Destination:=rng4
End If
Next
1. I would like to add a line of description to the Destination
worksheet (such as "Comparison Results") in the Worksheets("Unique");
2. I would like to color the lines found in Sheet1 before they are
copied to Worksheets("Unique");
-----------------------------------------
With Worksheets("Sheet1")
Set rng1 = .Range(.Cells(1, 1), .Cells(Rows.Count, 1).End(xlUp))
End With
With Worksheets("Sheet2")
Set rng2 = .Range(.Cells(1, 1), .Cells(Rows.Count, 1).End(xlUp))
End With
For Each cell In rng1
res = Application.Match(cell, rng2, 0)
If Not IsError(res) Then
Set rng3 = rng2(res)
Set rng4 = Worksheets("Match").Cells(Rows.Count,
1).End(xlUp)(2)
cell.EntireRow.Copy Destination:=rng4
Else
Set rng4 = Worksheets("Unique").Cells(Rows.Count,
1).End(xlUp)(2)
cell.EntireRow.Copy Destination:=rng4
End If
Next