Hi
Given below macro for send mail of sheet 1 of an excel work book.IN this work book there are two sheets.which field is need to be edited for sending mail "sheet 2"
Dim sourcebook As Workbook
Dim Sourcesheet As Worksheet
Set sourcebook = ActiveWorkbook
Set Sourcesheet = sourcebook.Sheets("sheet1")
' Select the range of cells on the active worksheet.
Range("A1:G65").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 = "aaa"
.Item.To = "xdx@gmail.com"
.Item.Subject = "Daily Production report " & Format(Date, "dd/mmm/yy")
.Item.Send
End With
End sub
Given below macro for send mail of sheet 1 of an excel work book.IN this work book there are two sheets.which field is need to be edited for sending mail "sheet 2"
Dim sourcebook As Workbook
Dim Sourcesheet As Worksheet
Set sourcebook = ActiveWorkbook
Set Sourcesheet = sourcebook.Sheets("sheet1")
' Select the range of cells on the active worksheet.
Range("A1:G65").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 = "aaa"
.Item.To = "xdx@gmail.com"
.Item.Subject = "Daily Production report " & Format(Date, "dd/mmm/yy")
.Item.Send
End With
End sub