Compare 2 Excell Sheets

G

Guest

I have 2 Excell sheets with >20 colums and >20000 rows in it.
I need a formula which should chekup the cell A1 value in sheet 1 and search
in Sheets 2 from top to bottom, if it founds it should put a remark
"matched", and if it not matches, "un matched" and like wise the entire
sheet1.

Thanks in advance
 
G

Guest

Hi,
Kindly let me know i have to paste in vba??

Gary''s Student said:
Here is a demo that may help you:

Sub markup()
Dim found As String
Set r1 = Sheets("Sheet1").UsedRange
r1.ClearComments
Set r2 = Sheets("Sheet2").UsedRange
For Each rr1 In r1
v = rr1.Value
If IsEmpty(v) Then
Else
found = "Not "
For Each rr2 In r2
If v = rr2.Value Then
found = ""
End If
Next
rr1.AddComment
rr1.Comment.Visible = True
rr1.Comment.Text Text:=found & "found"
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top