ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Duplicates across tabs (https://www.excelbanter.com/excel-programming/310189-duplicates-across-tabs.html)

stevem[_7_]

Duplicates across tabs
 
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

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


GJones

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/

.


stevem[_9_]

Duplicates across tabs
 
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.

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



All times are GMT +1. The time now is 12:33 PM.

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