ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   subtracting one csv file from another (https://www.excelbanter.com/excel-programming/401901-subtracting-one-csv-file-another.html)

generate

subtracting one csv file from another
 
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

joel

subtracting one csv file from another
 
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

"generate" wrote:

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



All times are GMT +1. The time now is 08:51 PM.

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