subtracting one csv file from another

  • Thread starter Thread starter generate
  • Start date Start date
G

generate

Hi there.

I have not been able to find a solution to this because it's hard to
know what to call what I want to do . ..

I commonly need to remove a list of records in a csv file from another
csv file.

The application is email marketing; if I need to send a reminder email
for an event, I want to remove all the people that have already
registered from the master list first.

So if I have a csv file with 25,000 odd records in it, and another
with 125 say, how can I find these 125 records in the master list so I
can delete them?

All suggestions greatly appreciated!

If there is a function or application or macro that does this, please
point me in the right direction

thanks
 
Assuming both CSV files are opened in Excel


Sub RemoveRegistered()

RegisterRowCount = 1
With Workbooks("Register.csv").Sheets("Sheet1")
Do While .Range("A" & RegisterRowCount) <> ""
Emailaddr = .Range("A" & RegisterRowCount)

With Workbooks("Master.csv").Sheets("Sheet1")
Set c = .Columns("A:A").Find(what:=Emailaddr, _
LookIn:=xlValues)
If Not c Is Nothing Then
c.EntireRow.Delete
End If
End With
RegisterRowCount = RegisterRowCount + 1
Loop
End With

End Sub
 

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