![]() |
Email Help Please
Hello,
I'm using this code from Ron but I want to email all sheets in the workbook to the email address in Sheet "Dial" cell J13. But the code is just senting the Dial sheet. Can you please take a look at the code and give me a hint? Sub Mail_Every_Worksheet() Dim sh As Worksheet Dim wb As Workbook Dim strdate As String Application.ScreenUpdating = False For Each sh In ThisWorkbook.Worksheets If sh.Range("J13").Value Like "?*@?*.?*" Then strdate = Format(Now, "dd-mm-yy h-mm-ss") sh.Copy Set wb = ActiveWorkbook With wb .SaveAs "Sheet " & sh.Name & " of " _ & ThisWorkbook.Name & " " & strdate & ".xls" .SendMail ActiveSheet.Range("J13").Value, _ "This is the Subject line" .ChangeFileAccess xlReadOnly Kill .FullName .Close False End With End If Next sh Application.ScreenUpdating = True End Sub |
Email Help Please
Nevermind... Thanks Guys I figured it out....
Lime "Lime" wrote: Hello, I'm using this code from Ron but I want to email all sheets in the workbook to the email address in Sheet "Dial" cell J13. But the code is just senting the Dial sheet. Can you please take a look at the code and give me a hint? Sub Mail_Every_Worksheet() Dim sh As Worksheet Dim wb As Workbook Dim strdate As String Application.ScreenUpdating = False For Each sh In ThisWorkbook.Worksheets If sh.Range("J13").Value Like "?*@?*.?*" Then strdate = Format(Now, "dd-mm-yy h-mm-ss") sh.Copy Set wb = ActiveWorkbook With wb .SaveAs "Sheet " & sh.Name & " of " _ & ThisWorkbook.Name & " " & strdate & ".xls" .SendMail ActiveSheet.Range("J13").Value, _ "This is the Subject line" .ChangeFileAccess xlReadOnly Kill .FullName .Close False End With End If Next sh Application.ScreenUpdating = True End Sub |
All times are GMT +1. The time now is 04:00 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com