Refresh, split data and email data using VBA

Tenny47

New Member
Joined
Sep 10, 2018
Messages
3
Hello all,

I'm new to this site and it was recommended by afriend - thankyou for letting me join.

I'm not familiar VBA but aware of the powerful thingsit can achieve so look forward to developing my knowledge.

I was hoping there was a code available which I could use in a Macro.

I have an ODBC connection linked to an excel workbookand this contains lots of information relevant to customers. I would like to do the following:

1. Refresh the sheet.
2. Split the refreshed data into separateworksheets based on a value within the sheet (Customer name for example).
3. Name the 'new' sheet based on that customer.
4. Generate emails for each customer based on anemail address within the Customer worksheets and save to my draft email folder- the email ideally will contain predefined text and also a copy of the worksheetthat is only relevant to that customer.

Will it be possible to decide which emails aregenerated? For now I only want togenerate emails for a predefined list of customers but would like a worksheet for all customers to be generated so I can review.

Can the macro access be hidden when theworksheet is attached to the email so the recipient can't see the code?

Thankyou in advance.

<strike></strike>
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hello and welcome!

Trust me you have come to the right place. I started just like you and found this amazing place and learned so much.

To answer your questions... yes that is absolutely possible.

You can have a list of all of your customers and simply select the ones you wish to run this report for.

Unfortunately I do not have access to my old files as I have moved jobs and I had something that did something similar to this already ...

More than likely someone will chime in.

Good luck with everything
 
Upvote 0

Forum statistics

Threads
1,215,459
Messages
6,124,948
Members
449,198
Latest member
MhammadishaqKhan

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