E-mail macro

slipperyjim

Board Regular
Joined
May 2, 2009
Messages
142
Hi,
I have a simple e-mail macro that works, however, someone that understands VBA would need to enter the email addresses if they are to change, which it is likely they will.

is it possible to set up this macro so that when clicked it will email out to a list of peole in a cell range?

the cell range: Sheet "Data", Range U17:U39

in these cells are the email addresses typed like this:
firstname.lastname @ business.com.au


not all of the cells in the range will be populated.

if possible could it be set up to just type in the front of the email address as the back is always the same e.g

firstname.lastname (macro code will add the @business.com.au bit)

thanks for any help offered.
 
Jim
My code runs OK until it gets to
Code:
.Display
.send

The "Send" line gives the Automation error
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Jim
Change this line:
Code:
nameList = nameList & "" & Sheets("Data").Range("Z" & i).Value
to this
Code:
nameList = nameList & ";" & Sheets("Data").Range("Z" & i).Value

Mine works fine
 
Upvote 0
geez all because of the little ";" i removed. that will teach me wont it. :biggrin:


thank you everyone very much for your help.
 
Upvote 0
Great news
What about sending the "attachment", eg, one of the sheets in your workbook.
or aren't you sending anything but the Email
 
Upvote 0
no mate, no attachments. Purely only to inform those in the contact list of an incident that has happened. it was designed to get notice to the "big bosses' quickly and for them to decide if it should be investigated or not.
 
Upvote 0
No worries
But if you need to send a file, it's simply an extra line in the code.
Strange as it seems, I've been writing macros to send a report to a heap of other people myself.
But when I started with your thread, I realised I could use it to do my mailing as well.
So by helping each other out, I can now send the active workbook to my client list.

Looks like we both win.
 
Upvote 0
slipperyjim, is there any way to get this to work for emailing a UserFrom? i have been trying for ages but getting nowhere. sheets are ok but the UserForm is a different beast.
 
Upvote 0

Forum statistics

Threads
1,224,045
Messages
6,176,063
Members
452,703
Latest member
kinnowboxes

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