ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Compare 2 Excell Sheets (https://www.excelbanter.com/excel-discussion-misc-queries/124304-compare-2-excell-sheets.html)

vijaydsk1970

Compare 2 Excell Sheets
 
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


Gary''s Student

Compare 2 Excell Sheets
 
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
--
Gary's Student


"vijaydsk1970" wrote:

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


vijaydsk1970

Compare 2 Excell Sheets
 
Hi,
Kindly let me know i have to paste in vba??

"Gary''s Student" wrote:

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
--
Gary's Student


"vijaydsk1970" wrote:

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



All times are GMT +1. The time now is 03:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com