Code to add today's date in subject line VBA

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

I found a nice bit of code for sending an email to a list
from within Excel. I am hoping that somebody can provide
me with a bit more code to insert today's date
in the subject line below.. so it would read "PET
Allshort and Missort Report TODAY'S DATE"

Thanks, Steve -

Sub E_Mail()
'sends the activeworkbook to the e-mail address in a
range named "list" in Sheet 'a sheet named E-Mail
Dim MyArr As Variant
MyArr = Sheets("Sheet1").Range("list")
'Will send with the subject send email.xls
'ActiveWorkbook.SendMail MyArr
ActiveWorkbook.SendMail Recipients:=MyArr, _
Subject:="PET AllShort and Missort Report"
'Resets "look in" to my documents
'ChDir "C:\My Documents"
End Sub
 
Try:
:="PET AllShort and Missort Report" & Format$(Date, "mm-dd-yyyy")
________________________

**** Hope it helps! ****

~Dreamboat
Finally! Excel VBA Certification
www.VBAExpress.com/training/
********************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top