View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Lime Lime is offline
external usenet poster
 
Posts: 56
Default 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