macro to filter spreadsheet by customer code, send relevant data via email

Newport Count

Active Member
Joined
Oct 25, 2009
Messages
328
Hi there,

I can't seem to find anything that does the job for this request, so thought i would ask the group.

I have a simple spreadsheet with various pieces of customer data displayed, relevant to each month of the year split into tabs (tabs are called "Jan", "Feb" etc and feature a macro button on each tab to hopefully do the following):

What I want to do is click the macro button on any monthly tab which will filter the spreadsheet by Column L (customer unique code e.g. 10001234) for all customers present in the spreadsheet and send each customer's data as a separate 'temp' workbook on an email (the temp workbook does not need to be saved anywhere). This should be repeated for each customer in Column L and the data on the separate emailed workbook should not contain any other customer's data i.e. it cannot include another customer's data that is hidden i.e. filtered off. Customers will appear multiple times on each monthly tab and should be grouped together for one email send.

I have a list of emails for each customer code in a separate tab ("Lookup") on the spreadsheet that details the customer code in column A and the emails in column B.

Hope that makes sense!


Many thanks,
Rich
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Got there in the end - please ignore (I will close).

Used my usual copy and paste bits of code to do each step in sequence and pieced it all together with an email send.
 
Upvote 0
Good to hear you got the solution.
If you would like to post the actual solution then it is perfectly fine to mark your post as the solution to help future readers. Otherwise, please do not mark a post that doesn't contain a solution.
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,173
Members
452,615
Latest member
bogeys2birdies

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