ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   .HTMLBody (https://www.excelbanter.com/excel-programming/396381-htmlbody.html)

Greg H.[_3_]

.HTMLBody
 
Im having problems with the code below displaying the text on one line. E4
is reference to a date i select in the worksheet.

.htmlBody = Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)"
& _
Format(Range("E4") - 1, "mm/dd") & " ECCR (Daily, MTD)" & _
Format(Range("E4"), "mm/dd") & " ECCR (Daily, MTD)"

The result should look like this:

08/24 ECCR (Daily, MTD)

08/25 ECCR (Daily, MTD)

08/26 ECCR (Daily, MTD)

Any Ideas?

Ron de Bruin

.HTMLBody
 
You can use <br to start a new line

See the Tips here
http://www.rondebruin.nl/mail/tips2.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Greg H." wrote in message ...
Im having problems with the code below displaying the text on one line. E4
is reference to a date i select in the worksheet.

.htmlBody = Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)"
& _
Format(Range("E4") - 1, "mm/dd") & " ECCR (Daily, MTD)" & _
Format(Range("E4"), "mm/dd") & " ECCR (Daily, MTD)"

The result should look like this:

08/24 ECCR (Daily, MTD)

08/25 ECCR (Daily, MTD)

08/26 ECCR (Daily, MTD)

Any Ideas?


Tom Ogilvy

.HTMLBody
 
.htmlBody = Format(Range("E4") - 2, "mm/dd") & _
" ECCR (Daily, MTD)" & vbCrLf & _
Format(Range("E4") - 1, "mm/dd") & _
" ECCR (Daily, MTD)" & vbCrLf & _
Format(Range("E4"), "mm/dd") & _
" ECCR (Daily, MTD)"

--
Regards,
Tom Ogilvy


"Greg H." wrote:

Im having problems with the code below displaying the text on one line. E4
is reference to a date i select in the worksheet.

.htmlBody = Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)"
& _
Format(Range("E4") - 1, "mm/dd") & " ECCR (Daily, MTD)" & _
Format(Range("E4"), "mm/dd") & " ECCR (Daily, MTD)"

The result should look like this:

08/24 ECCR (Daily, MTD)

08/25 ECCR (Daily, MTD)

08/26 ECCR (Daily, MTD)

Any Ideas?


Greg H.[_3_]

.HTMLBody
 
Unfortunately this does not work. And when i try what Ron sugested, using
<br i do this:

.htmlBody = Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)"
<br & _
Format(Range("E4") - 1, "mm/dd") & " ECCR (Daily, MTD)"
<br & _
Format(Range("E4"), "mm/dd") & " ECCR (Daily, MTD)"

And i get this error: "Compile error: Syntax error" and it highlights the &
after the <br. Any ideas?

"Tom Ogilvy" wrote:

.htmlBody = Format(Range("E4") - 2, "mm/dd") & _
" ECCR (Daily, MTD)" & vbCrLf & _
Format(Range("E4") - 1, "mm/dd") & _
" ECCR (Daily, MTD)" & vbCrLf & _
Format(Range("E4"), "mm/dd") & _
" ECCR (Daily, MTD)"

--
Regards,
Tom Ogilvy


"Greg H." wrote:

Im having problems with the code below displaying the text on one line. E4
is reference to a date i select in the worksheet.

.htmlBody = Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)"
& _
Format(Range("E4") - 1, "mm/dd") & " ECCR (Daily, MTD)" & _
Format(Range("E4"), "mm/dd") & " ECCR (Daily, MTD)"

The result should look like this:

08/24 ECCR (Daily, MTD)

08/25 ECCR (Daily, MTD)

08/26 ECCR (Daily, MTD)

Any Ideas?


Ron de Bruin

.HTMLBody
 
See this example

<br is between the " "

strbody = "<H3<BDear Customer</B</H3" & _
"Please visit this website to download the new version.<br" & _
"Let me know if you have problems.<br" & _
"<A HREF=""http://www.rondebruin.nl/""Ron's Excel Page</A" & _
"<br<br<BThank you</B"

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Greg H." wrote in message ...
Unfortunately this does not work. And when i try what Ron sugested, using
<br i do this:

.htmlBody = Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)"
<br & _
Format(Range("E4") - 1, "mm/dd") & " ECCR (Daily, MTD)"
<br & _
Format(Range("E4"), "mm/dd") & " ECCR (Daily, MTD)"

And i get this error: "Compile error: Syntax error" and it highlights the &
after the <br. Any ideas?

"Tom Ogilvy" wrote:

.htmlBody = Format(Range("E4") - 2, "mm/dd") & _
" ECCR (Daily, MTD)" & vbCrLf & _
Format(Range("E4") - 1, "mm/dd") & _
" ECCR (Daily, MTD)" & vbCrLf & _
Format(Range("E4"), "mm/dd") & _
" ECCR (Daily, MTD)"

--
Regards,
Tom Ogilvy


"Greg H." wrote:

Im having problems with the code below displaying the text on one line. E4
is reference to a date i select in the worksheet.

.htmlBody = Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)"
& _
Format(Range("E4") - 1, "mm/dd") & " ECCR (Daily, MTD)" & _
Format(Range("E4"), "mm/dd") & " ECCR (Daily, MTD)"

The result should look like this:

08/24 ECCR (Daily, MTD)

08/25 ECCR (Daily, MTD)

08/26 ECCR (Daily, MTD)

Any Ideas?


Greg H.[_3_]

.HTMLBody
 
When i apply the "" i receve the error of : "Compile Error: Syntax Error" and
it highlights E4 in "Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)"
<br" & _

"Ron de Bruin" wrote:

See this example

<br is between the " "

strbody = "<H3<BDear Customer</B</H3" & _
"Please visit this website to download the new version.<br" & _
"Let me know if you have problems.<br" & _
"<A HREF=""http://www.rondebruin.nl/""Ron's Excel Page</A" & _
"<br<br<BThank you</B"

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Greg H." wrote in message ...
Unfortunately this does not work. And when i try what Ron sugested, using
<br i do this:

.htmlBody = Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)"
<br & _
Format(Range("E4") - 1, "mm/dd") & " ECCR (Daily, MTD)"
<br & _
Format(Range("E4"), "mm/dd") & " ECCR (Daily, MTD)"

And i get this error: "Compile error: Syntax error" and it highlights the &
after the <br. Any ideas?

"Tom Ogilvy" wrote:

.htmlBody = Format(Range("E4") - 2, "mm/dd") & _
" ECCR (Daily, MTD)" & vbCrLf & _
Format(Range("E4") - 1, "mm/dd") & _
" ECCR (Daily, MTD)" & vbCrLf & _
Format(Range("E4"), "mm/dd") & _
" ECCR (Daily, MTD)"

--
Regards,
Tom Ogilvy


"Greg H." wrote:

Im having problems with the code below displaying the text on one line. E4
is reference to a date i select in the worksheet.

.htmlBody = Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)"
& _
Format(Range("E4") - 1, "mm/dd") & " ECCR (Daily, MTD)" & _
Format(Range("E4"), "mm/dd") & " ECCR (Daily, MTD)"

The result should look like this:

08/24 ECCR (Daily, MTD)

08/25 ECCR (Daily, MTD)

08/26 ECCR (Daily, MTD)

Any Ideas?



Ron de Bruin

.HTMLBody
 
Use it like this

strbody = "<H3<BDear Customer</B</H3" & _
Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)<br" & _
Format(Range("E4") - 1, "mm/dd") & " ECCR (Daily, MTD)<br" & _
Format(Range("E4"), "mm/dd") & " ECCR (Daily, MTD)<br" & _
"<br<br<BThank you</B"


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Greg H." wrote in message ...
When i apply the "" i receve the error of : "Compile Error: Syntax Error" and
it highlights E4 in "Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)"
<br" & _

"Ron de Bruin" wrote:

See this example

<br is between the " "

strbody = "<H3<BDear Customer</B</H3" & _
"Please visit this website to download the new version.<br" & _
"Let me know if you have problems.<br" & _
"<A HREF=""http://www.rondebruin.nl/""Ron's Excel Page</A" & _
"<br<br<BThank you</B"

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Greg H." wrote in message ...
Unfortunately this does not work. And when i try what Ron sugested, using
<br i do this:

.htmlBody = Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)"
<br & _
Format(Range("E4") - 1, "mm/dd") & " ECCR (Daily, MTD)"
<br & _
Format(Range("E4"), "mm/dd") & " ECCR (Daily, MTD)"

And i get this error: "Compile error: Syntax error" and it highlights the &
after the <br. Any ideas?

"Tom Ogilvy" wrote:

.htmlBody = Format(Range("E4") - 2, "mm/dd") & _
" ECCR (Daily, MTD)" & vbCrLf & _
Format(Range("E4") - 1, "mm/dd") & _
" ECCR (Daily, MTD)" & vbCrLf & _
Format(Range("E4"), "mm/dd") & _
" ECCR (Daily, MTD)"

--
Regards,
Tom Ogilvy


"Greg H." wrote:

Im having problems with the code below displaying the text on one line. E4
is reference to a date i select in the worksheet.

.htmlBody = Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)"
& _
Format(Range("E4") - 1, "mm/dd") & " ECCR (Daily, MTD)" & _
Format(Range("E4"), "mm/dd") & " ECCR (Daily, MTD)"

The result should look like this:

08/24 ECCR (Daily, MTD)

08/25 ECCR (Daily, MTD)

08/26 ECCR (Daily, MTD)

Any Ideas?



Greg H.[_3_]

.HTMLBody
 
That was it. Thanks so much. I really appreciate the help and patience.

"Ron de Bruin" wrote:

Use it like this

strbody = "<H3<BDear Customer</B</H3" & _
Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)<br" & _
Format(Range("E4") - 1, "mm/dd") & " ECCR (Daily, MTD)<br" & _
Format(Range("E4"), "mm/dd") & " ECCR (Daily, MTD)<br" & _
"<br<br<BThank you</B"


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Greg H." wrote in message ...
When i apply the "" i receve the error of : "Compile Error: Syntax Error" and
it highlights E4 in "Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)"
<br" & _

"Ron de Bruin" wrote:

See this example

<br is between the " "

strbody = "<H3<BDear Customer</B</H3" & _
"Please visit this website to download the new version.<br" & _
"Let me know if you have problems.<br" & _
"<A HREF=""http://www.rondebruin.nl/""Ron's Excel Page</A" & _
"<br<br<BThank you</B"

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Greg H." wrote in message ...
Unfortunately this does not work. And when i try what Ron sugested, using
<br i do this:

.htmlBody = Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)"
<br & _
Format(Range("E4") - 1, "mm/dd") & " ECCR (Daily, MTD)"
<br & _
Format(Range("E4"), "mm/dd") & " ECCR (Daily, MTD)"

And i get this error: "Compile error: Syntax error" and it highlights the &
after the <br. Any ideas?

"Tom Ogilvy" wrote:

.htmlBody = Format(Range("E4") - 2, "mm/dd") & _
" ECCR (Daily, MTD)" & vbCrLf & _
Format(Range("E4") - 1, "mm/dd") & _
" ECCR (Daily, MTD)" & vbCrLf & _
Format(Range("E4"), "mm/dd") & _
" ECCR (Daily, MTD)"

--
Regards,
Tom Ogilvy


"Greg H." wrote:

Im having problems with the code below displaying the text on one line. E4
is reference to a date i select in the worksheet.

.htmlBody = Format(Range("E4") - 2, "mm/dd") & " ECCR (Daily, MTD)"
& _
Format(Range("E4") - 1, "mm/dd") & " ECCR (Daily, MTD)" & _
Format(Range("E4"), "mm/dd") & " ECCR (Daily, MTD)"

The result should look like this:

08/24 ECCR (Daily, MTD)

08/25 ECCR (Daily, MTD)

08/26 ECCR (Daily, MTD)

Any Ideas?




All times are GMT +1. The time now is 09:35 AM.

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