Hello
I have a code that help you send an email to customer. However, the code sets as default customer. Do you know how to change the code so that I can type manually customer email address when the command pops up. Moreover, the code is to send the entire workbook, how can we only send the active sheet or specific sheet that we want.
Sub cmdEmailSheet_Click()
Dim txtMsg, txtStyle, txtTitle, Response
txtMsg = "Are you sure you want to e-mail the active sheet to Tan?" ' Define message.
txtStyle = vbYesNo + vbQuestion + vbDefaultButton2 ' Define buttons.
txtTitle = "Confirm E-mail" ' Define title.
Response = MsgBox(txtMsg, txtStyle, txtTitle)
If Response = vbYes Then ' User chose Yes.
ActiveWorkbook.SendMail Recipients:="allannguyen@yahoo.com"
txtMsg = "E-mail composed and sent to the Outbox." ' Define message.
txtStyle = vbInformation ' Define buttons.
txtTitle = "E-mail Sent" ' Define title.
Response = MsgBox(txtMsg, txtStyle, txtTitle)
End If
End Sub
Bookmarks