Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Need help comparing & flagging email lists in separate worksheets

Problem:

column1 of worksheet1 contains a list of bad email addresses


column1 of worksheet2 contains a list of all email addresses on file


i need to compare the list of bad addresses (worksheet1) to the list of

all email addresses (worksheet2) and if there is an email address in
the bad list (worksheet1) which is also in the all emails
list(worksheet2), i need to flag it by putting "bad" in the next column

of the all addresses list (worksheet2).


i've been looking through this forum for the past few days and can't
seem to find something that can do this. it looks like it should be
simple but i've had no luck. any help would be appreciated.


p.s. the all email address list (worksheet2) can be quite long...around

8000 rows.


Rich

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Need help comparing & flagging email lists in separate worksheets

Sub MarkBad()
Dim iRow As Long
Dim c1 As Range
Dim c2 As Range
Dim rng1 As Range
Dim rng2 As Range

iRow = Worksheets("Sheet1").Range("A1").End(xlDown).Row
Set rng1 = Worksheets("Sheet1").Range("A1:A" & iRow)
iRow = Worksheets("Sheet2").Range("A1").End(xlDown).Row
Set rng2 = Worksheets("Sheet2").Range("A1:A" & iRow)
For Each c1 In rng1
For Each c2 In rng2
If c1 = c2 Then c2.Offset(0, 1) = "bad"
Next c2
Next c1
End Sub

HTH,
Merjet

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Need help comparing & flagging email lists in separate worksheets

Rich,

You can do this with a formula - no VBA required. Assuming your "all email"
list starts in cell A2 of sheet "All" and the bad email list are in cell A2
to A2000 of sheet "Bad", paste this formula in cell B2 of sheet "All" and
copy down to the last email:

=IF(COUNTIF(bad!$A$2:$A$2000,all!$A2)0,"bad","")

hth,

Doug

wrote in message
oups.com...
Problem:

column1 of worksheet1 contains a list of bad email addresses


column1 of worksheet2 contains a list of all email addresses on file


i need to compare the list of bad addresses (worksheet1) to the list of

all email addresses (worksheet2) and if there is an email address in
the bad list (worksheet1) which is also in the all emails
list(worksheet2), i need to flag it by putting "bad" in the next column

of the all addresses list (worksheet2).


i've been looking through this forum for the past few days and can't
seem to find something that can do this. it looks like it should be
simple but i've had no luck. any help would be appreciated.


p.s. the all email address list (worksheet2) can be quite long...around

8000 rows.


Rich



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Need help comparing & flagging email lists in separate worksheets

Hey Doug,

I tried pasting this formula but it ended up not flagging anything at
all. The only thing I changed were the ranges a bit. Here's what I
have:

=IF(COUNTIF(bad!$A$1:$A$1307,all!$A1)0,"bad","")

any thoughts?

Doug Glancy wrote:
Rich,

You can do this with a formula - no VBA required. Assuming your "all email"
list starts in cell A2 of sheet "All" and the bad email list are in cell A2
to A2000 of sheet "Bad", paste this formula in cell B2 of sheet "All" and
copy down to the last email:

=IF(COUNTIF(bad!$A$2:$A$2000,all!$A2)0,"bad","")

hth,

Doug

wrote in message
oups.com...
Problem:

column1 of worksheet1 contains a list of bad email addresses


column1 of worksheet2 contains a list of all email addresses on file


i need to compare the list of bad addresses (worksheet1) to the list of

all email addresses (worksheet2) and if there is an email address in
the bad list (worksheet1) which is also in the all emails
list(worksheet2), i need to flag it by putting "bad" in the next column

of the all addresses list (worksheet2).


i've been looking through this forum for the past few days and can't
seem to find something that can do this. it looks like it should be
simple but i've had no luck. any help would be appreciated.


p.s. the all email address list (worksheet2) can be quite long...around

8000 rows.


Rich


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Need help comparing & flagging email lists in separate worksheets

Rich,

Just to make sure we're doing the same thing, the bad email addresses are on
a sheet named "bad" in cells A1 to A1307. The ones to be tested are on a
sheet named "all" in column A. The formula was copied down so that the row
references to "all" are relative. For example, the formula in All!B2 should
be:

=IF(COUNTIF(bad!$A$1:$A$1307,all!$A2)0,"bad","")

Notice that the "all!$A1" in the first row formula has changed to "all!$A2".
In other words, the formula is always looking at the address in the adjacent
cell and looking to see if it matches any addresses on "bad".

If that's all true, I'm not sure what else to check, unless of course there
are no bad email addresses in "all" ...

hth,

Doug

wrote in message
ups.com...
Hey Doug,

I tried pasting this formula but it ended up not flagging anything at
all. The only thing I changed were the ranges a bit. Here's what I
have:

=IF(COUNTIF(bad!$A$1:$A$1307,all!$A1)0,"bad","")

any thoughts?

Doug Glancy wrote:
Rich,

You can do this with a formula - no VBA required. Assuming your "all
email"
list starts in cell A2 of sheet "All" and the bad email list are in cell
A2
to A2000 of sheet "Bad", paste this formula in cell B2 of sheet "All" and
copy down to the last email:

=IF(COUNTIF(bad!$A$2:$A$2000,all!$A2)0,"bad","")

hth,

Doug

wrote in message
oups.com...
Problem:

column1 of worksheet1 contains a list of bad email addresses


column1 of worksheet2 contains a list of all email addresses on file


i need to compare the list of bad addresses (worksheet1) to the list of

all email addresses (worksheet2) and if there is an email address in
the bad list (worksheet1) which is also in the all emails
list(worksheet2), i need to flag it by putting "bad" in the next column

of the all addresses list (worksheet2).


i've been looking through this forum for the past few days and can't
seem to find something that can do this. it looks like it should be
simple but i've had no luck. any help would be appreciated.


p.s. the all email address list (worksheet2) can be quite long...around

8000 rows.


Rich






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
Flagging all records present in two (or more) separate lists Maki Excel Discussion (Misc queries) 2 October 23rd 08 12:34 PM
Need help comparing & flagging email lists [email protected] Excel Discussion (Misc queries) 6 January 18th 07 09:17 PM
Comparing two email lists Bjarni Excel Discussion (Misc queries) 1 October 13th 05 06:16 PM
Vlookup - Comparing two lists in different worksheets Lozby Excel Worksheet Functions 3 August 9th 05 12:14 PM
need help comparing data in 2 separate worksheets \Wayne via OfficeKB.com\ Excel Worksheet Functions 0 July 6th 05 09:02 PM


All times are GMT +1. The time now is 04:12 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"