View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default Find & Delete Duplicates across two Excel Worksheets

you may want to have a for each loop
a look in vba help index for FIND would have given you this

Sub findinlist()
For Each c In[lista]
MsgBox[listb].Find(c).Address
Next c
End Sub
Sub findallinlist()
For Each x In[lista]
With[listb]
Set c = .Find(x, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
MsgBox c.Address
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
Next x
End Sub
--
Don Guillett
SalesAid Software

"Lance" wrote in message
oups.com...
Hi Everyone,

I've done my research on other Google groups and have attempted other
VBA codes, but have been unlucky and unable to do this task. Hope you
all can help.

Workbook Structure

I have 2 worksheets in the workbook, called 'HR' & 'Oracle'.
Both sheets contain Unique Values for that sheet in Column A.
The unique values are NOT orders the same on both sheets and can appear
anywhere between A1 and A5000 on either sheets.
The sheet 'Oracle' has up-to-date information
The sheet 'HR' is the least up-to-date

(Still with me? Good)

Required Action

I need to check the values from 'Oracle' Colmun A against the values
from 'HR' Colmun A. If the system finds values in 'HR' that are in
'Oracle', then it should delete the whole Row in 'HR'. Remember that
the Values are not ordered in any way and can appear anywhere in Column
A on both sheets.

Sample of 'HR' worksheet

A B
0000049821 KELLY M
0000053167 LEACH D
0000054090 LEACH G
0000061784 MILLING G
0000061220 MILLS S
0000069255 MULHERN N
0000063288 MCNEILL P
0000067363 NELSON F

Thank you all for your help & time,

Lance