• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA code to send mail range/selection in the body from different worksheets

Rodrigues

Member
Hi there
I'm looking for a vba code to send email in the body picking up different range of cells from a different sheets:
I.e.: sheet 1 range bp9:bk21
sheet 2 range d14:f100
sheet 3 range ab20:ac40 and so on.

I managed to set a code for the first sheet (range bp9:bk21) and works fine when I open the email on a laptop, but doesn't work when I open the email on mobile, the info it's all over and doesn't make sense.

Code I'm using:
Code:
Sub SendEmail()
 
  ' Select the range of cells on the active worksheet.
  ActiveSheet.Range("BK9:BP21").Select
 
  ' Show the envelope on the ActiveWorkbook.
  ActiveWorkbook.EnvelopeVisible = True
 
  ' Set the optional introduction field thats adds
  ' some header text to the email body. It also sets
  ' the To and Subject lines. Finally the message
  ' is sent.
  With ActiveSheet.MailEnvelope
  .Introduction = "This is an email test"
  .Item.To = "myemail@email.com"
  .Item.Subject = "figures"
  .Item.Send
  End With

End Sub
Any help it will be much appreciated.
Regards
Rodrigues
 
Last edited by a moderator:
Hi there
I'm looking for a vba code to send email in the body picking up different range of cells from a different sheets:
I.e.: sheet 1 range bp9:bk21
sheet 2 range d14:f100
sheet 3 range ab20:ac40 and so on.

I managed to set a code for the first sheet (range bp9:bk21) and works fine when I open the email on a laptop, but doesn't work when I open the email on mobile, the info it's all over and doesn't make sense.

Code I'm using:
Sub SendEmail()

' Select the range of cells on the active worksheet.
ActiveSheet.Range("BK9:BP21").Select

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

' Set the optional introduction field thats adds
' some header text to the email body. It also sets
' the To and Subject lines. Finally the message
' is sent.
With ActiveSheet.MailEnvelope
.Introduction = "This is an email test"
.Item.To = "myemail@email.com"
.Item.Subject = "figures"
.Item.Send
End With

End Sub

Any help it will be much appreciated.
Regards
Rodrigues


Hello Rodrigues,

Hope this post will be of help to you:
http://forum.chandoo.org/threads/vb...umn-then-send-email-solved.18484/#post-111672

Regards,
Don
 
Back
Top