Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Compare column in 2 documents

I have two documents: one with a sendlist, one with a directory of names and
addresses. In the sendlist I have about 1200 posts, and in the directory
about 900.
Now I need to check if the mailaddresses in the directory are also in the
sendlist.

It looks like this:
Directory:
Name Address Phone E-mail
Brita xxx 555
Carl yyy 777


Sendlist:
E-mail List 1 List 2
x
x x

I want this outcome:
Name Address Phone E-mail Added
Brita xxx 555
YES
Carl yyy 777


So, I need to add a column in my directory where I can see a mark if that
post is also in the Sendlist.

I use Excel 2003 with SP3.

I tried to combine VLOOKUP and IF but just couldn't get it to work.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,071
Default Compare column in 2 documents

Amiranda
Place this macro in the Directory workbook. I assumed that the
Directory workbook is named "Directory.xls" and the Send List workbook is
named "Send List.xls". Change that in the code. I also assumed the sheet
in the Directory workbook is named "This" and the sheet in the Send List
workbook is named "That". Change those as needed. Come back if you need
more. HTH Otto
Sub CompareWBs()
Dim ShDir As Worksheet, ShSend As Worksheet
Dim ColADir As Range, ColASend As Range
Dim i As Range
Application.ScreenUpdating = False
Set ShDir = Workbooks("Directory.xls").Sheets("This")
Set ShSend = Workbooks("Send List.xls").Sheets("That")
With ShDir
Set ColADir = .Range("D2", .Range("D" & Rows.Count).End(xlUp))
End With
With ShSend
Set ColASend = .Range("A2", .Range("A" & Rows.Count).End(xlUp))
End With
For Each i In ColADir
If Not ColASend.Find(What:=i.Value, LookAt:=xlWhole) Is Nothing Then
i.Offset(, 1).Value = "YES"
End If
Next i
Application.ScreenUpdating = True
End Sub



"Amiranda" wrote in message
...
I have two documents: one with a sendlist, one with a directory of names
and
addresses. In the sendlist I have about 1200 posts, and in the directory
about 900.
Now I need to check if the mailaddresses in the directory are also in the
sendlist.

It looks like this:
Directory:
Name Address Phone E-mail
Brita xxx 555
Carl yyy 777


Sendlist:
E-mail List 1 List 2
x
x x

I want this outcome:
Name Address Phone E-mail Added
Brita xxx 555
YES
Carl yyy 777


So, I need to add a column in my directory where I can see a mark if that
post is also in the Sendlist.

I use Excel 2003 with SP3.

I tried to combine VLOOKUP and IF but just couldn't get it to work.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Compare column in 2 documents

works perfectly,
thank you so much!!

"Otto Moehrbach" skrev:

Amiranda
Place this macro in the Directory workbook. I assumed that the
Directory workbook is named "Directory.xls" and the Send List workbook is
named "Send List.xls". Change that in the code. I also assumed the sheet
in the Directory workbook is named "This" and the sheet in the Send List
workbook is named "That". Change those as needed. Come back if you need
more. HTH Otto
Sub CompareWBs()
Dim ShDir As Worksheet, ShSend As Worksheet
Dim ColADir As Range, ColASend As Range
Dim i As Range
Application.ScreenUpdating = False
Set ShDir = Workbooks("Directory.xls").Sheets("This")
Set ShSend = Workbooks("Send List.xls").Sheets("That")
With ShDir
Set ColADir = .Range("D2", .Range("D" & Rows.Count).End(xlUp))
End With
With ShSend
Set ColASend = .Range("A2", .Range("A" & Rows.Count).End(xlUp))
End With
For Each i In ColADir
If Not ColASend.Find(What:=i.Value, LookAt:=xlWhole) Is Nothing Then
i.Offset(, 1).Value = "YES"
End If
Next i
Application.ScreenUpdating = True
End Sub



"Amiranda" wrote in message
...
I have two documents: one with a sendlist, one with a directory of names
and
addresses. In the sendlist I have about 1200 posts, and in the directory
about 900.
Now I need to check if the mailaddresses in the directory are also in the
sendlist.

It looks like this:
Directory:
Name Address Phone E-mail
Brita xxx 555
Carl yyy 777


Sendlist:
E-mail List 1 List 2
x
x x

I want this outcome:
Name Address Phone E-mail Added
Brita xxx 555
YES
Carl yyy 777


So, I need to add a column in my directory where I can see a mark if that
post is also in the Sendlist.

I use Excel 2003 with SP3.

I tried to combine VLOOKUP and IF but just couldn't get it to work.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I compare and merge two separate documents? jazzchamp Excel Discussion (Misc queries) 0 August 15th 06 11:55 PM
compare cells of different external documents VC++User Excel Worksheet Functions 1 June 1st 06 02:12 PM
How do I compare two simular excel documents croberts Excel Worksheet Functions 0 April 5th 06 10:19 PM
How do I compare 2 documents? Excelling in Tampa Excel Discussion (Misc queries) 1 February 8th 06 02:29 AM
Question: Compare and Merge Documents Littlebear Excel Discussion (Misc queries) 1 November 17th 05 07:40 PM


All times are GMT +1. The time now is 11:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"