PC Review


Reply
Thread Tools Rate Thread

Compare column in 2 documents

 
 
Amiranda
Guest
Posts: n/a
 
      25th Aug 2008
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 (E-Mail Removed)
Carl yyy 777 (E-Mail Removed)

Sendlist:
E-mail List 1 List 2
(E-Mail Removed) x
(E-Mail Removed) x x

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

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 With Quote
 
 
 
 
Otto Moehrbach
Guest
Posts: n/a
 
      25th Aug 2008
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" <(E-Mail Removed)> wrote in message
news:9AE1EA26-A0A4-4063-9622-(E-Mail Removed)...
>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 (E-Mail Removed)
> Carl yyy 777 (E-Mail Removed)
>
> Sendlist:
> E-mail List 1 List 2
> (E-Mail Removed) x
> (E-Mail Removed) x x
>
> I want this outcome:
> Name Address Phone E-mail Added
> Brita xxx 555 (E-Mail Removed) YES
> Carl yyy 777 (E-Mail Removed)
>
> 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 With Quote
 
Amiranda
Guest
Posts: n/a
 
      4th Sep 2008
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" <(E-Mail Removed)> wrote in message
> news:9AE1EA26-A0A4-4063-9622-(E-Mail Removed)...
> >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 (E-Mail Removed)
> > Carl yyy 777 (E-Mail Removed)
> >
> > Sendlist:
> > E-mail List 1 List 2
> > (E-Mail Removed) x
> > (E-Mail Removed) x x
> >
> > I want this outcome:
> > Name Address Phone E-mail Added
> > Brita xxx 555 (E-Mail Removed) YES
> > Carl yyy 777 (E-Mail Removed)
> >
> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP: Compare Column values with column names in different tables sam Microsoft Access Form Coding 4 26th May 2010 07:56 PM
How to convert two-column documents into a single column documents? Jorge Cerva tes Microsoft Word New Users 4 10th Dec 2009 07:58 PM
compare cells in column to criteria, then average next column cell Bradwin Microsoft Excel Worksheet Functions 2 21st Jul 2008 08:37 PM
compare data from one column with another and compare result to yet another Matt Williamson Microsoft Excel Programming 1 25th Sep 2003 08:54 PM
compare data from one column with another and compare result to yet another Matt Williamson Microsoft Excel Worksheet Functions 1 25th Sep 2003 08:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:34 PM.