View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GJones GJones is offline
external usenet poster
 
Posts: 132
Default Duplicates across tabs

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
-----Original Message-----
Ok, have a little problem I need some help on.

I've look at pearson's site, but didn't see anything that

would work
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 first
worksheet with Column A of the second worksheet and check

for
duplicates.

What I need is that if the any text in column H on the

first worksheet
matches any text in column A of the second worksheet,

need to select
the row from the first worksheet that contians that

duplicate.

Thanks in advance.


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

.