Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have five columns...one called "action required" and under this column I
have a drop down that has four options "n/a" , "Grp1" , "Grp2", "Grp3" I would input the data....choose "Grp1".....what I want to happen is when I choose "Grp1" and close the file an email notification to be sent to 2 people. But when I choose "Grp2" and close the file an email notification will be sent to 3 different people. And when I choose "Grp3" and close the file a different group of people will be sent an email notification. When I choose "n/a" no notification will be sent. How do I this? What I have done so far (which isn't much).... I have this macro (see below) that when you close the file a pop-up box appears that ask you if you want to send an email notification to a list of people saying that you've made an update to the file. Macro: Private Sub Workbook_BeforeClose(Cancel As Boolean) 'define variables Dim answer As String 'get user action answer = MsgBox("Send update notice?", vbYesNo, "Confirmation") 'if user wants to send update, send; otherwise just close the document If answer = vbYes Then 'open outlook type stuff Set OutlookApp = CreateObject("Outlook.Application") Set OlObjects = OutlookApp.GetNamespace("MAPI") Set newmsg = OutlookApp.CreateItem(olMailItem) 'add recipients 'newmsg.Recipients.Add ("Melanie Hauser") newmsg.Recipients.Add ("Liz Withnell") newmsg.Recipients.Add ("Pat Myer") newmsg.Recipients.Add ("Linda Burnim") 'add subject newmsg.Subject = "Configurator Spreadsheet Update" 'add body newmsg.Body = "The configurator spreadsheet has been modified." newmsg.Display 'display newmsg.Send 'send message 'give conformation of sent message MsgBox "Update notice has been sent.", , "Confirmation" ElseIf answer = vbNo Then 'give conformation of no sent message MsgBox "No notice has been sent.", , "Confirmation" End If 'save the document 'Me.Worksheets.Save End Sub Please help! Melanie |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
excel - Taking a list of people and adding them to 2 columns | Excel Discussion (Misc queries) | |||
How to send email to a list of people in excel sheet? | Excel Discussion (Misc queries) | |||
How does the excel file update e-mail notify work? | Excel Worksheet Functions | |||
how do you turn an email address list into an Excel csv or txt file? | Excel Worksheet Functions | |||
Send Email from Excel - but only to people in range | Excel Programming |