How do i get all the unique emails out of a column and add into an email

frostworks

New Member
Joined
Jan 28, 2024
Messages
13
Office Version
  1. 365
Platform
  1. Windows
As per the title, i would like to know how to call out all the unique emails in Col F and add into a string? the code has to count all unique visible emails dynamically so i suppose there will be the use of end(xlup) or end(xldown)?
1706455117705.png


In my vba code, i have dim EmailAdd as String.
1706455197698.png
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I assumed that your data in column F started in F5

VBA Code:
Sub jec()
 Dim dic As Object, it
 Set dic = CreateObject("scripting.dictionary")
 
 For Each it In Range("F5", Range("F" & Rows.Count).End(xlUp))
   dic(it.Value) = Empty
 Next
 
 With CreateObject("outlook.application").createitem(0)
   .to = Join(dic.keys, ";")
   .Subject = "test"
   .attachments.Add "..."
   .display
 End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,390
Messages
6,124,670
Members
449,178
Latest member
Emilou

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top