add 2nd Name and Date to Code

  • Thread starter Thread starter Wanna Learn
  • Start date Start date
W

Wanna Learn

Hi I copied this code from Ron de Bruins site everything was fine until I
tried to add a 2nd name to the TO: field and to the subject line I want to
add todays date

below is the part of the code that I need help with thanks in advance


On Error Resume Next
With OutMail
.To = " I WANT TO ADD 2 NAMES HERE"
.CC = ""
.BCC = ""
.Subject = " Stats for" here I WANT TO ADD TODAY'S DATE
 
On Error Resume Next
With OutMail
.To = array("(e-mail address removed)","(e-mail address removed)")
.CC = ""
.BCC = ""
.Subject = " Stats for " & text(date, "mm/dd/yyyy")
 
Whoops!

Use:

.Subject = " Stats for " & Format(date, "mm/dd/yyyy")

=text() is a worksheet function. Format is the VBA function.
 

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