VBA - Excel >> Outlook copy multiple ranges to email body

smet1234

New Member
Joined
Sep 24, 2013
Messages
4
Hi All,

I'm not good with VBA, but have made a macrothat will autosend an email from Excel via Outlook when a certain condition is met (i.e. cell x value = cell y value). The email body contains information from a range of cells using the "Select.Range()...." functionality. I would like the email body to contain information more than one range, located at different locations on the sheet. So, for instance, if I could have the first row of the email body contain Range("A1:F1"), and a second row of the email body contain Range("A7:D7"), that would be perfect.

Any help is greatly appreciated. Thank you!


-S
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Thanks for your reply. Bit scrappy but here it is:

Code:
Sub EmailInfo()

ActiveWorkbook.EnvelopeVisible = True


If Sheets("Volume").Range("C2").Value = Sheets("Volume").Range("E2").Value Then
ActiveSheet.Range("A2:F2").Select


With ActiveSheet.MailEnvelope
.Introduction = "Hi"
.Item.To = "XXXXX"
.Item.Subject = "Test"
.Item.Send
End With


Else: Exit Sub


End If


End Sub

Basically, the
Code:
ActiveSheet.Range("A2:F2").Select
is what I'm having trouble with. Somehow, I want to copy this and put it into a .Item.Body = ....... or something like that, so I can combine multiple ranges into different rows of the email body.
 
Upvote 0

Forum statistics

Threads
1,215,310
Messages
6,124,188
Members
449,147
Latest member
sweetkt327

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