Hello, just getting stuck on a little thing here and wondered if anyone could help?
I have a command button to email a sheet, it's too much information for everyone on the mailing list so I'm hoping to just pop in a data range into the .body. I'm having problems is there a snippet to pop in here to grab some cells?
Much appreciated if anyone has 2 mins to look over it.
Private Sub CommandButton1_Click()
Dim xOutApp As Object
Dim xOutMail As Object
Dim xMailBody As String
On Error Resume Next
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
< THIS BIT BELOW>
xMailBody = "** This is an automated email from the Onsite Trade Schedule **" & vbNewLine & vbNewLine & _
"Please find the following information for your reference below." & vbNewLine
<pesky cell="" range="" needed="" here="" <CELL RANGE TO GO HERE>
On Error Resume Next
With xOutMail
.To = "#"
.CC = "#"
.BCC = "#"
.Subject = "Onsite Trade Schedule"
.Body = xMailBody
.Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
End Sub</pesky>
I have a command button to email a sheet, it's too much information for everyone on the mailing list so I'm hoping to just pop in a data range into the .body. I'm having problems is there a snippet to pop in here to grab some cells?
Much appreciated if anyone has 2 mins to look over it.
Private Sub CommandButton1_Click()
Dim xOutApp As Object
Dim xOutMail As Object
Dim xMailBody As String
On Error Resume Next
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
< THIS BIT BELOW>
xMailBody = "** This is an automated email from the Onsite Trade Schedule **" & vbNewLine & vbNewLine & _
"Please find the following information for your reference below." & vbNewLine
<pesky cell="" range="" needed="" here="" <CELL RANGE TO GO HERE>
On Error Resume Next
With xOutMail
.To = "#"
.CC = "#"
.BCC = "#"
.Subject = "Onsite Trade Schedule"
.Body = xMailBody
.Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
End Sub</pesky>