ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   vba code runs...need spaces ........ (https://www.excelbanter.com/excel-discussion-misc-queries/217105-vba-code-runs-need-spaces.html)

Wanna Learn

vba code runs...need spaces ........
 
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


Mike H

vba code runs...need spaces ........
 
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

"Wanna Learn" wrote:

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


Bob Phillips

vba code runs...need spaces ........
 
..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)

"Wanna Learn" wrote in message
...
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





All times are GMT +1. The time now is 12:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com