Duplicates across tabs

  • Thread starter Thread starter stevem
  • Start date Start date
S

stevem

Ok, have a little problem I need some help on.

I've look at pearson's site, but didn't see anything that would wor
for me (if I'm wrong, please point me in the right direction)

I have 2 worksheets. I need to look compare column H from the firs
worksheet with Column A of the second worksheet and check fo
duplicates.

What I need is that if the any text in column H on the first workshee
matches any text in column A of the second worksheet, need to selec
the row from the first worksheet that contians that duplicate.

Thanks in advance
 
Hi Stevem;

You can use this;

Sub TryCompare()
Sheets("Sheet1").Select
HomeSheet = activeworksheet.Name
Cells(1, 1).Select
Sheets("Sheet2").Select
OtherSheet = ActiveSheet.Name
Cells(1, 8).Select

Sheets(HomeSheet).Select

While Not ActiveCell = ""

MyTextToLookFor = ActiveCell
Sheets(OtherSheet).Select
Cells(1, 8).Select
Do While Not ActiveCell = ""
If Trim(ActiveCell) = Trim(MyTextToLookFor)
Then
'here is where you copy the line and put
it somewhere
ActiveCell.EntireRow.Copy
Exit Do
End If
ActiveCell.Offset(1, 0).Select
Wend

ActiveCell.Offset(1, 0).Select
Wend
End Sub

Thanks,

Greg
 
Sorry, that code didn't work, compile errors, and I couldn't fix i
myself.

Opened a new thread with better explanation (I hope)

Thanks for the help though, it did get me thinking, and got my brai
back into the Excel mode of things.
 

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