Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using Macro how to create email link for the email addresses in aRange or Selection | Excel Worksheet Functions | |||
send wkbk as an email attachment with an email address copied from | Excel Discussion (Misc queries) | |||
can I copy a column of email addresses, paste into email address? | New Users to Excel | |||
Transfer Email addresses from spreadsheet to email address book | Excel Discussion (Misc queries) | |||
Email editor closes when forwarding Excel-embedded email | Setting up and Configuration of Excel |