compare data on 2 sheets

  • Thread starter Thread starter pauluk
  • Start date Start date
P

pauluk

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
 
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.Value)
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
 
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
 
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
 

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

Back
Top