View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Paul Robinson Paul Robinson is offline
external usenet poster
 
Posts: 208
Default Duplicate Email Addresses

Hi Bill,
Make a collection instead of an array of your email addresses.
Duplicates won't arise and you can loop through the collection to
post:

Dim EmailCollection as new Collection
Dim EmailAddress as Variant

On error resume next
For a = 1 to 7
EmailCollection.Add Cells(a, 2), Cstr(Cells(a, 2))
next a
on error goto 0
'code...
For each EmailAddress in EmailCollection
'whatever code you had
next EmailAddress

regards

Paul

"Bill Oertell" wrote in message ...
I have a workbook that needs to get sent out to several different recipients.
Occasionally some of those recipients might be duplicates. How can I make sure
that duplicate recipients receive only one copy of the workbook?

What I've done to read the list of email recipients is use a for-next loop.
Something like this:

For a = 1 to 7
email(a) = Cells(a, 2) 'assuming the list is in column B
next a

Then I use another for-next loop to email the workbook. I'll bet there's
probably a better way of doing this. Any help would be appreciated. Thanks.