» Mail every Worksheet with address in cell A1 using VBA in Microsoft Excel
VBA macro tip contributed by Ron de Bruin, Microsoft MVP - Excel
CATEGORY - Mail - Send and Receive in VBA
VERSION - All Microsoft Excel Versions
- Create a new workbook with the Sheet.
- Save the workbook before mailing it
- Delete the file from your hard disk after it is sent.
Sub Mail_every_Worksheet()
Dim strDate As String
Dim sh As Worksheet
Application.ScreenUpdating = False
For Each sh In ThisWorkbook.Worksheets
If sh.Range("a1").Value Like "*@*" Then
sh.Copy
strDate = Format(Date, "dd-mm-yy") & " " & Format(Time, "h-mm-ss")
ActiveWorkbook.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strDate & ".xls"
ActiveWorkbook.SendMail ActiveSheet.Range("a1").Value, _
"This is the Subject line"
ActiveWorkbook.ChangeFileAccess xlReadOnly
Kill ActiveWorkbook.FullName
ActiveWorkbook.Close False
End If
Next sh
Application.ScreenUpdating = True
End Sub
Book Store:
Recommended Books:
- Windows XP Annoyances
- Who Moved My Cheese? An Amazing Way to Deal with Change in Your Work and in Your Life
- Special Edition Using Microsoft Outlook 2002
- Real Estate Finance and Investments (Real Estate Finance and Investments, 11th Ed)
- The Basics of Finance: Financial Tools for Non Financial Managers
- What the IRS Doesn't Want You to Know: A Cpa Reveals the Tricks of the Trade
No comments have been submitted.

