vba code runs...need spaces ........

W

Wanna Learn

Hello
..Subject = "Credit-Notice " & Range("R14").Value & Range("AR35 ").Value &
Range("AC11").Value & Range("S10 ").Value

The above code is in my subject line in the "Sub Mail_ Active sheet ()"
When the macro runs everything in the subject line of the e mail is one
sentence
example Credit-Notice1234567WaterWorks100.00
I want the subject line to read Credit-Notice, Invoice No 12, Acct No 34567,
Company Water Works , Amount 10.00
Thanks in advance
 
M

Mike H

Hi,

Create a constant of ", " and put it between each element of your string

Const gap As String = ", "
Subject = "Credit-Notice" & gap & Range("R14").Value _
& gap & Range("AR35 ").Value & gap & Range("AC11").Value & gap & Range("S10
").Value

Mike
 
B

Bob Phillips

..Subject = Join(Array("Credit-Notice", Range("R14").Value, _
Range("AR35").Value, Range("AC11").Value,
Range("S10").Value), " ")


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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

Top