![]() |
AUTOMATICALLY SENDING EMAIL VIA A MACRO
Good afternoon excel Gurus,
I currently have a macro button for when pressed it saves the excel sheet and automatically sends emails to 2 other users in the company to say this excel sheet is ready for review. What i now need to happen is when the manager opens this excel sheet I am going to create an 'Approval' button so when pressed is will say: Are you sure you want to approve this PIP? Click yes, save as to a specific location location detailing a cell reference B10 for the name of the file, click no it will automatically reply to the person who submitted this excel workbook saying plese review your PIP as it as been declined. Below you will see my current code for this to work: Sub save() ActiveWorkbook.save Dim OutApp As Object Dim OutMail As Object Dim strbody As String Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0) strbody = "PIP" & " for " & Sheets("PROFIT IMPROVEMENT PLAN").Range("B10").Value & " " & _ Sheets("PROFIT IMPROVEMENT PLAN").Range("B11").Value & " " & "Ready For Review" On Error Resume Next With OutMail .To = ; " .CC = "" .BCC = "" .Subject = "PIP Ready For Review" .Body = strbody .Send End With On Error GoTo 0 Set OutMail = Nothing Set OutApp = Nothing Application.DisplayAlerts = True Application.ScreenUpdating = True End Sub |
All times are GMT +1. The time now is 03:12 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com