L
lehainam
Dear all,
I have a macro to mail many sheets as belows:
Sub Mail_every_Worksheet()
'Mail every Worksheet with address in cell B4 using VBA in Microsoft
Excel
'Dim strDate As String
Dim sh As Worksheet
Application.ScreenUpdating = False
For Each sh In ThisWorkbook.Worksheets
If sh.Range("B4").Value Like "*@*" And sh.Name <> "Form" Then
sh.Copy
'strDate = Format(Date, "dd-mm-yy") & " " & Format(Time,
"h-mm-ss")
ActiveWorkbook.SaveAs sh.Name & ".xls"
ActiveWorkbook.SendMail ActiveSheet.Range("B4").Value, _
ActiveSheet.Name
ActiveWorkbook.ChangeFileAccess xlReadOnly
Kill ActiveWorkbook.FullName
ActiveWorkbook.Close False
End If
Next sh
Application.ScreenUpdating = True
End Sub
However, I don't know how to put the content of this email, for ex.
"This is the salary of Jun 05".
Could any one can help me to add the content to my email.
Thanks a lot!
Nam
I have a macro to mail many sheets as belows:
Sub Mail_every_Worksheet()
'Mail every Worksheet with address in cell B4 using VBA in Microsoft
Excel
'Dim strDate As String
Dim sh As Worksheet
Application.ScreenUpdating = False
For Each sh In ThisWorkbook.Worksheets
If sh.Range("B4").Value Like "*@*" And sh.Name <> "Form" Then
sh.Copy
'strDate = Format(Date, "dd-mm-yy") & " " & Format(Time,
"h-mm-ss")
ActiveWorkbook.SaveAs sh.Name & ".xls"
ActiveWorkbook.SendMail ActiveSheet.Range("B4").Value, _
ActiveSheet.Name
ActiveWorkbook.ChangeFileAccess xlReadOnly
Kill ActiveWorkbook.FullName
ActiveWorkbook.Close False
End If
Next sh
Application.ScreenUpdating = True
End Sub
However, I don't know how to put the content of this email, for ex.
"This is the salary of Jun 05".
Could any one can help me to add the content to my email.
Thanks a lot!
Nam