VBA - Loop/Filter and Send Email

eddymx

New Member
Joined
Mar 29, 2017
Messages
1
Hi,

i want to do the following, from the table below i want to:

1-Filter per column C for unique values
2-Once filtered if its only "1" row, then put each cell on that row into a variable.
3-Once filtered if the results is more than 1 records, meaning the same email address has 2 or more records then grab all the range from A to E (range to HTML).
4- Paste the information in an Email (outlook app 2010).
5-Loop until column B hits a blank cell, which means its the end.

Table Example:
Record IDEmailDataDataData
Record1test1@test.com111
Record2test2@test.com222
Record3test1@test.com333

<tbody>
</tbody>

At the end, the following emails should be sent or display:
1- One email with 2 rows with all columns from A to E to test1@test.com in a range to Html.
2- one email with 1 row with all columns from A to E to test2@test.com in variable then paste them into HTML.

i need the VBA logic since all the examples i have been reading doesnt fit this exact way i want to do it.

Thank you so much for reading!
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,215,523
Messages
6,125,318
Members
449,218
Latest member
Excel Master

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