Re: Compare 2 columns in different sheets, and Copy entire rows into new sheets
I found My Error. I had to add .EntireRow.Copy. It works now.
Code
ThisWorkbook.RefreshAll
Dim rng As Range, c As Range, cfind As Range
On Error Resume Next
Worksheets("New").Cells.Clear
With Worksheets("Weekly")
Set rng = .Range(.Range("C1"), .Range("c1").End(xlDown))
For Each c In rng
c = Replace(c, " ", "")
With Worksheets("SharePoint")
Set cfind = .Columns("C:Z").Cells.Find _
(what:=c.Value, lookat:=xlWhole)
If cfind Is Nothing Then
c.Resize(1, 26).Copy Worksheets(3).Cells(Worksheets(3).Rows.Count, "A").End(xlUp).Offset(1, 0)
End If
End With 'weekly
Next c
Application.CutCopyMode = False
End With 'sharepoint
Worksheets("Cancels").Cells.Clear
With Worksheets("Sharepoint")
Set rng = .Range(.Range("C2"), .Range("c2").End(xlDown))
For Each c In rng
c = Replace(c, " ", "")
With Worksheets("Weekly")
Set cfind = .Columns("C:Z").Cells.Find _
(what:=c.Value, lookat:=xlWhole)
If cfind Is Nothing Then
c.Resize(1, 26).Copy Worksheets(4).Cells(Worksheets(4).Rows.Count, "A").End(xlUp).Offset(1, 0)
End If
End With 'weekly
Next c
Application.CutCopyMode = False
End With 'sharepoint
End Sub
Display More