ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   compare data on 2 sheets (https://www.excelbanter.com/excel-programming/302409-compare-data-2-sheets.html)

pauluk[_67_]

compare data on 2 sheets
 
This is what am looking to do,

To compare data or two sheets

So say sheet2 G4=exceltip

and in sheet1 it then searches though G:G finds that cell G100 of shee
1 matches then it places X in cell H4 of sheet2

And Does this until Cell G# is empty

Thanks
Pau

--
Message posted from http://www.ExcelForum.com


Bernie Deitrick

compare data on 2 sheets
 
Paul,

Sub TryNow()
Dim myCell As Range
Dim myFind As Range

With Worksheets("Sheet2")
For Each myCell In .Range(.Range("G4"), .Range("G4").End(xlDown))
Set myFind = Worksheets("Sheet1").Range("G:G").Find(myCell.Valu e)
If Not myFind Is Nothing Then myCell(1, 2).Value = "X"
Next myCell
End With

End Sub

You could also do this with a formula in Column H....

HTH,
Bernie
MS Excel MVP

"pauluk " wrote in message
...
This is what am looking to do,

To compare data or two sheets

So say sheet2 G4=exceltip

and in sheet1 it then searches though G:G finds that cell G100 of sheet
1 matches then it places X in cell H4 of sheet2

And Does this until Cell G# is empty

Thanks
Paul


---
Message posted from http://www.ExcelForum.com/




BrianB

compare data on 2 sheets
 
A simple VLOOKUP should do the job. In cell H4 put formula :-
=IF(ISERROR(VLOOKUP(G4,Sheet1!G:G,1,FALSE)),"","X" )

and copy down

--
Message posted from http://www.ExcelForum.com


Bernie Deitrick

compare data on 2 sheets
 
Brian,

Yes, your formula will work, but this is the programming group. So,
perhaps, post code to put that formula into cell H4 and to copy it down to
match column G. The OP may also not want formulas, so also include code to
convert those formulas to values.

Bernie
MS Excel MVP

"BrianB " wrote in message
...
A simple VLOOKUP should do the job. In cell H4 put formula :-
=IF(ISERROR(VLOOKUP(G4,Sheet1!G:G,1,FALSE)),"","X" )

and copy down.


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 01:16 AM.

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