Auto email send to Recipients update in spreadsheet using Excel
Closed
limktin
Posts
4
Registration date
Wednesday October 2, 2013
Status
Member
Last seen
October 7, 2013
-
Oct 2, 2013 at 05:18 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Oct 8, 2013 at 10:37 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Oct 8, 2013 at 10:37 AM
Related:
- Auto email send to Recipients update in spreadsheet using Excel
- Net send windows 11 - Guide
- Grand theft auto v free download no verification for pc - Download - Action and adventure
- How to stop auto refresh in facebook app - Guide
- Grand theft auto iv download apk for pc - Download - Action and adventure
- Number to words in excel - Guide
6 responses
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Oct 3, 2013 at 10:57 AM
Oct 3, 2013 at 10:57 AM
Hi Limktin,
Assuming that review person's email address is the last entry in column B.
Change:
newmsg.Recipients.Add ("sampleemailaddresshere@email.com")
into:
newmsg.Recipients.Add (Range("B"&rows.count).end(xlup).value)
Best regards,
Trowa
Assuming that review person's email address is the last entry in column B.
Change:
newmsg.Recipients.Add ("sampleemailaddresshere@email.com")
into:
newmsg.Recipients.Add (Range("B"&rows.count).end(xlup).value)
Best regards,
Trowa
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Oct 7, 2013 at 10:37 AM
Oct 7, 2013 at 10:37 AM
Hi Limktin,
Try this:
Best regards,
Trowa
Try this:
Dim lRow, x As Integer
lRow = Range("B" & Rows.Count).End(xlUp).Row
For Each cell In Range(Cells(lRow, "A"), Cells(lRow, "L"))
If cell.Value <> vbNullString Then
x = x + 1
End If
Next cell
If x <> 12 Then MsgBox "Please check the last entry. There is at least 1 empty cell found in column A:L", , "Missing data"
Best regards,
Trowa
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Oct 8, 2013 at 10:37 AM
Oct 8, 2013 at 10:37 AM
Sorry Limktin, didn't thought it through.
Try this:
You can always add some text to instruct users to hit the 'Send Email' button again.
Best regards,
Trowa
Monday, Tuesday and Thursday are usually the days I'll respond. Bear this in mind when awaiting a reply.
Try this:
Dim lRow, x As Integer
lRow = Range("B" & Rows.Count).End(xlUp).Row
For Each cell In Range(Cells(lRow, "A"), Cells(lRow, "L"))
If cell.Value <> vbNullString Then
x = x + 1
End If
Next cell
If x <> 12 Then
MsgBox "Please check the last entry. There is at least 1 empty cell found in column A:L", , "Missing data"
Exit Sub
End If
You can always add some text to instruct users to hit the 'Send Email' button again.
Best regards,
Trowa
Monday, Tuesday and Thursday are usually the days I'll respond. Bear this in mind when awaiting a reply.
limktin
Posts
4
Registration date
Wednesday October 2, 2013
Status
Member
Last seen
October 7, 2013
Oct 2, 2013 at 05:27 AM
Oct 2, 2013 at 05:27 AM
i see this coding in this forum, it's work for me but the problem is how to make the Recipients as variable and copy from spreadsheet once someone enter, and also add in person (also a variable) enter in email sent
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Dim answer As String
answer = MsgBox("This is where you put the text to prompt the user if he wants to save or not" vbYesNo, "here is the title of that box")
If answer = vbNo Then Cancel = True
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 ("Name Here")
newmsg.Recipients.Add ("sampleemailaddresshere@email.com")
'add subject
newmsg.Subject = "Subject line of auto email here"
'add body
newmsg.Body = "body of auto email here"
newmsg.Display 'display
newmsg.Send 'send message
'give conformation of sent message
MsgBox "insert confirmation box test here", , "title of confirmation box"
End If
'save the document
'Me.Worksheets.Save
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Dim answer As String
answer = MsgBox("This is where you put the text to prompt the user if he wants to save or not" vbYesNo, "here is the title of that box")
If answer = vbNo Then Cancel = True
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 ("Name Here")
newmsg.Recipients.Add ("sampleemailaddresshere@email.com")
'add subject
newmsg.Subject = "Subject line of auto email here"
'add body
newmsg.Body = "body of auto email here"
newmsg.Display 'display
newmsg.Send 'send message
'give conformation of sent message
MsgBox "insert confirmation box test here", , "title of confirmation box"
End If
'save the document
'Me.Worksheets.Save
End Sub
Didn't find the answer you are looking for?
Ask a question
limktin
Posts
4
Registration date
Wednesday October 2, 2013
Status
Member
Last seen
October 7, 2013
Oct 3, 2013 at 11:41 PM
Oct 3, 2013 at 11:41 PM
thanks, it's do work.
If I would like to set a condition that ensure there is info entry from column A to L example, if not it will prompt message. Would able to advice for the code?
If I would like to set a condition that ensure there is info entry from column A to L example, if not it will prompt message. Would able to advice for the code?
limktin
Posts
4
Registration date
Wednesday October 2, 2013
Status
Member
Last seen
October 7, 2013
Oct 7, 2013 at 10:42 PM
Oct 7, 2013 at 10:42 PM
Thanks TrowaD again.
the codes looks good, so after the message box prompt out, program should stop and allow the entry person to correct the infor, after that only re-click on 'Send Email' button to send out mail. But the coding above after message box click ok, email still will send out to the person but it's not suppose to me, perhaps we still need one or two sentence to work out on that.
the codes looks good, so after the message box prompt out, program should stop and allow the entry person to correct the infor, after that only re-click on 'Send Email' button to send out mail. But the coding above after message box click ok, email still will send out to the person but it's not suppose to me, perhaps we still need one or two sentence to work out on that.