Hi
I have got the following code to send an email from however I would like to add a few things to it. This all takes place in Sheet 2 of the spreadsheet
1. I would like to add an If function so that If cell G24>0 if performs the email send. If it is 0 or empty no email is sent
2. For the body of the email text I would like it to send cells A31:G32 as the text and nothing else.
Appreciate any help or comments
Thanks
Daniel
Sub SendEmail()
On Error GoTo ErrHandler
Dim objOutlook As Object
Set objOutlook = CreateObject("Outlook.Application")
Dim objEmail As Object
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail
.To = "daniel@***.com"
.Subject = "Information"
.Body = " "
.Display
End With
Set objEmail = Nothing: Set objOutlook = Nothing
ErrHandler:
End Sub
I have got the following code to send an email from however I would like to add a few things to it. This all takes place in Sheet 2 of the spreadsheet
1. I would like to add an If function so that If cell G24>0 if performs the email send. If it is 0 or empty no email is sent
2. For the body of the email text I would like it to send cells A31:G32 as the text and nothing else.
Appreciate any help or comments
Thanks
Daniel
Sub SendEmail()
On Error GoTo ErrHandler
Dim objOutlook As Object
Set objOutlook = CreateObject("Outlook.Application")
Dim objEmail As Object
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail
.To = "daniel@***.com"
.Subject = "Information"
.Body = " "
.Display
End With
Set objEmail = Nothing: Set objOutlook = Nothing
ErrHandler:
End Sub