Attaching an Excel sheet to email????

Jaywar2013

New Member
Joined
Apr 5, 2013
Messages
23
Hi All

I have a VBA for sending out an email (Below) however I am struggling to think of how to attached a sheet to the same email. The Sheet/Tab I want to attach/send is called 'Send'


Sub SendEmail()Dim OutlookApp As Object
Dim MITem As Object
Dim Cell As Range
Dim Subj As String
Dim EmailAddr As String
Dim Answered As String
Dim Msg As String
Dim GOS As String
Dim CallRangOff As String
Dim NormalOpCall As String
Dim NoSuitable As String
Dim Total As String
Dim Wrap As String
Dim Recipient As String
Dim ATT As String
Dim ASO As String
Dim Signature As String






'Create Outlook object
Set OutlookApp = CreateObject("Outlook.Application")


'Loop through the rows
For Each Cell In _
Columns("c").Cells.SpecialCells(xlCellTypeConstants)
If Cell.Value Like "*@*" Then
'get the data
Subj = "NOC Call Stats " & Cell.Offset(0, 1)
Recipient = Cell.Offset(0, -2).Value
EmailAddr = Cell.Value
Answered = Format(Cell.Offset(0, 2).Value, "0.0%")
GOS = Format(Cell.Offset(0, 3).Value, "0.0%")
CallRangOff = Cell.Offset(0, 4).Value
NormalOpCall = Cell.Offset(0, 5).Value
NoSuitable = Cell.Offset(0, 6).Value
Total = Cell.Offset(0, 7).Value
Wrap = Cell.Offset(0, 8).Value
Wrap = Format(Cell.Offset(0, 8).Value, "0.0")
ATT = Cell.Offset(0, 9).Value
ATT = Format(Cell.Offset(0, 9).Value, "0.0")
ASO = Cell.Offset(0, 10).Value
ASO = Format(Cell.Offset(0, 10).Value, "0.0")
Signature = Cell.Offset(0, -1).Value






'Compose message
Msg = "Dear " & Recipient & vbCrLf & vbCrLf
Msg = Msg & "Please see the attached daily NOC call stats: " & vbCrLf & vbCrLf
Msg = Msg & "Answered = " & Answered & vbCrLf & vbCrLf
Msg = Msg & "Grade of Service = " & GOS & vbCrLf & vbCrLf
Msg = Msg & "Total Calls Offered = " & Total & vbCrLf & vbCrLf
Msg = Msg & "Total Calls Answered = " & NormalOpCall & vbCrLf & vbCrLf
Msg = Msg & "Calls Dropped = " & CallRangOff & vbCrLf & vbCrLf
Msg = Msg & "No Suitable Operator Logged on = " & NoSuitable & vbCrLf & vbCrLf
Msg = Msg & "Average Wrap = " & Wrap & vbCrLf & vbCrLf
Msg = Msg & "Average Talk Time = " & ATT & vbCrLf & vbCrLf
Msg = Msg & "Avg Speed of Answer = " & ASO
Msg = Msg & vbCrLf & vbCrLf & vbCrLf
Msg = Msg & Signature


'Create Mail Item and Send it
Set MITem = OutlookApp.CreateItem(0)
With MITem
.to = EmailAddr
.Subject = Subj
.body = Msg
.Display
End With
End If
Next


End Sub



Any Ideas?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,203,460
Messages
6,055,557
Members
444,797
Latest member
18ecooley

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