Using Filters to Auto-generate Emails

guy6

New Member
Joined
Feb 25, 2020
Messages
7
Office Version
  1. 2013
Platform
  1. Windows
Hi all,

I'm really stuck here, hoping you can help me with this!

I have a table in Excel and macros to autofilter the table, based on my various needs. Often, this table will bring back multiple results, but for the same individuals (e.g. four rows for Joe Bloggs and three rows for Jane Smith). In order to differentiate them, I am using a formula in Row A which gives each individual an index number for all of their rows (e.g. if Joe Bloggs has four rows, all four rows will have the same number).

What I am trying to do, is have the macro automatically generate an email to each individual including all of their results. I know how to generate the email, but I'm stuck on creating a loop in my code that will do the following:

Loop through a certain amount of numbers (1 to 50 lets say), to check if that number has been returned in the filtered results for row A.
If yes, it will proceed to filter the table to only include that number, execute the email generating macro, then remove this new filter to continue the loop and check for others.
The end result for the previous example would be two emails generated, with one including Joe Blogg's 4 rows and the other with Jane Smith's three rows.

Please let me know if there are any questions you have that may help me resolve this!

Thanks in advance,

Guy
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,215,645
Messages
6,125,995
Members
449,279
Latest member
Faraz5023

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