ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Emailing Cell contents in EXCEl using VB (https://www.excelbanter.com/excel-programming/384030-emailing-cell-contents-excel-using-vbulletin.html)

ian lewis

Emailing Cell contents in EXCEl using VB
 

I have an email script in VB but want it to just email the contents of
cell a2 and l2. Can anyone help? My current code is



Sub Send_Range()

' Select the range of cells on the active worksheet.
ActiveSheet.Range("L2").Select

' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = True


With ActiveSheet.MailEnvelope
.Introduction = "Please can you add the following to xxxxxxxxxxxx"
& vbCrLf & vbCrLf _
& "xxxxxxxxxxx- work stage " &
Worksheets("PM6").Range("l3").Value
.Item.To = "
.Item.cc = "
.Item.Subject = "Additional xxxxxxxxxxxx- work stage " &
Worksheets("PM6").Range("l3").Value

' .Item.Send

MsgBox "Please check that that contents of the subject box and
introduction are correct before pressing SEND.", vbOKOnly +
vbInformation


End With
End Sub



*** Sent via Developersdex http://www.developersdex.com ***

Ron de Bruin

Emailing Cell contents in EXCEl using VB
 
Hi Ian

Use this
http://www.rondebruin.nl/mail/folder3/smallmessage.htm

See this how you can use range values
http://www.rondebruin.nl/mail/tips2.htm



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"ian lewis" wrote in message ...

I have an email script in VB but want it to just email the contents of
cell a2 and l2. Can anyone help? My current code is



Sub Send_Range()

' Select the range of cells on the active worksheet.
ActiveSheet.Range("L2").Select

' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = True


With ActiveSheet.MailEnvelope
.Introduction = "Please can you add the following to xxxxxxxxxxxx"
& vbCrLf & vbCrLf _
& "xxxxxxxxxxx- work stage " &
Worksheets("PM6").Range("l3").Value
.Item.To = "
.Item.cc = "
.Item.Subject = "Additional xxxxxxxxxxxx- work stage " &
Worksheets("PM6").Range("l3").Value

' .Item.Send

MsgBox "Please check that that contents of the subject box and
introduction are correct before pressing SEND.", vbOKOnly +
vbInformation


End With
End Sub



*** Sent via Developersdex http://www.developersdex.com ***


FSt1

Emailing Cell contents in EXCEl using VB
 
hi,
See this site....
http://www.rondebruin.nl/sendmail.htm

regards
FSt1

"ian lewis" wrote:


I have an email script in VB but want it to just email the contents of
cell a2 and l2. Can anyone help? My current code is



Sub Send_Range()

' Select the range of cells on the active worksheet.
ActiveSheet.Range("L2").Select

' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = True


With ActiveSheet.MailEnvelope
.Introduction = "Please can you add the following to xxxxxxxxxxxx"
& vbCrLf & vbCrLf _
& "xxxxxxxxxxx- work stage " &
Worksheets("PM6").Range("l3").Value
.Item.To = "
.Item.cc = "
.Item.Subject = "Additional xxxxxxxxxxxx- work stage " &
Worksheets("PM6").Range("l3").Value

' .Item.Send

MsgBox "Please check that that contents of the subject box and
introduction are correct before pressing SEND.", vbOKOnly +
vbInformation


End With
End Sub



*** Sent via Developersdex http://www.developersdex.com ***



All times are GMT +1. The time now is 09:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com