How to find what's not there?

G

Guest

Any help on starting this would be greatly appreciated;
I have to find "new" accounts in a workbook.
Process wise, I think i need to open the "February" workbook,
and row by row look for the account number (column A) in the "January"
workbook.

If it's there, ignore it,
if NOT-then it's new and I need to add its entire row to a new sheet in the
Feb. book.

Thanks.
 
D

Don Guillett

Here is a sample of this

Sub findeach()
For Each c In Range("a2:a5")
'MsgBox c
With Sheets("yourworksheetname")
On Error Resume Next
Set mf = .Columns(1).Find(What:=c, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not mf Is Nothing Then
MsgBox mf & "found at " & mf.Row
End If
End With
Next
End Sub
 
G

Guest

Don,
Sorry for the delay, as I obviously did not post under "programming" like I
thought I did.

Anyway. Thanks very much for your help.
I'm assuming that ("yourworksheetname") can be in a completely different
workbook?
 

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

Top