Automatic Email of Workbooks

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
yes - set up a cell which contains the client email address (as a formula if it's variable - (ie as a LOOKUP or something))

Then

ActiveWorkbook.SendMail Recipients:=range("the cell")
 
Upvote 0
Let's say in Sheet 1 Range A1 I have a formula that does a look up on the basis of supplier in Cell A2 and gets the appropriate email address

A1 = Vlookup(a2,suppliers,2,false)

and this has then returned

j.bloggs@bloggsville.com

My macro to send this would be as follows:

Sub MAILSPREADSHEET ()

ActiveWorkbook.SendMail recipients:= sheets("sheet1").range("a1")

End Sub
 
Upvote 0
Try this
Sub Email()
ActiveWorkbook.SendMail Recipients:="XXXXX.com"
End Sub
 
Upvote 0
I believe something like this is what he means....("a4") would be the cell that your e-mail address is in that you want the workbook sent to...or you could hide it way over in cell "aa4" or anywhere...copy and paste this into a module in your workbook.

Sub sendmail()
ActiveWorkbook.sendmail Recipients:=Range("a4")

End Sub



Then you need to put this in your "sheet1"

Private Sub CommandButton1_Click()
sendmail
End Sub

This of course is assuming you created a command button on your worksheet...and then put your e-mail address in cell a4 in sheet1 to test it out...

Sorry if this isn't very clear, I'm not very good at explaining....:-/
 
Upvote 0
I believe something like this is what he means....("a4") would be the cell that your e-mail address is in that you want the workbook sent to...or you could hide it way over in cell "aa4" or anywhere...copy and paste this into a module in your workbook.

Sub sendmail()
ActiveWorkbook.sendmail Recipients:=Range("a4")

End Sub



Then you need to put this in your "sheet1"

Private Sub CommandButton1_Click()
sendmail
End Sub

This of course is assuming you created a command button on your worksheet...and then put your e-mail address in cell a4 in sheet1 to test it out...

Sorry if this isn't very clear, I'm not very good at explaining....:-/
 
Upvote 0

Forum statistics

Threads
1,214,529
Messages
6,120,070
Members
448,943
Latest member
sharmarick

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