Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub CommandButton1_Click()
- Dim OutApp As Object, OutMail As Object
- Dim rng As Range
- Dim StrBody As String
- StrBody = "Hi - see below ticket quality failures for last week:"
- Application.ScreenUpdating = False
- Set OutApp = CreateObject("Outlook.Application")
- Set rng = Nothing
- On Error Resume Next
- Set rng = Sheets("Macaulay").Range("Maccy").SpecialCells(xlCellTypeVisible)
- On Error GoTo cleanup
- Set OutMail = OutApp.CreateItem(0)
- On Error Resume Next
- With OutMail
- .To = "Macaulay.Kurlfinke@kennedyslaw.com"
- .Subject = "!TICKET QUALITY FAILURES!"
- .HTMLBody = StrBody & RangetoHTML(rng) & "<br><br> Let me know if there's any questions. <br><br> Regards,<br><br> Dumitru Reaboi"
- .Display 'Or use .Send .Display
- End With
- On Error GoTo 0
- Set OutMail = Nothing
- cleanup:
- Set OutApp = Nothing
- Application.ScreenUpdating = True
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement