-
[VBA]Sub DoCompare()
Dim cel As Range, tgt As Range
With Sheets("Sheet2")
For Each cel In Range(.Cells(1, 1), .Cells(Rows.Count, 1).End(xlUp))
If Sheets("Sheet1").Columns(1).Find(cel) Is Nothing Then
Set tgt = Sheets("Sheet3").Cells(Rows.Count, 1).End(xlUp).Offset(1)
If tgt.Row < 11 Then Set tgt = Sheets("Sheet3").Cells(11, 1)
cel.Resize(, 4).Copy tgt
End If
Next
End With
End Sub[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules