• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

vbCrLf function

Supriya

Member
Hello,


I was using vbCrLf function in macro but the code was not executed for this function. The text is not moving on next line.

pl help.


Supriya.
 
Hi Supriya ,


How are you using it ?


If you use it in a MsgBox statement , it should work.


If you use it to put text in a worksheet cell , then the cell needs to be formatted to Wrap Text. If you do not do this , then all of the text will display on one line.


Narayan
 
Hi,


.HTMLBody = "Dear Team," & vbCrLf & vbCrLf _

& "Kindly find the update on MTD & YTD Unit Wise Performance as on " & DT & " " & vbCrLf _

& RangetoHTML(rng) & vbCrLf _


Here is my code format


supriya.
 
Hi Supriya ,


Try using the HTML tag :

[pre]
Code:
<br>
as in :

.HTMLBody = "Dear Team," & "<br><br>" _
& "Kindly find the update on MTD & YTD Unit Wise Performance as on " & DT & "<br>" _
& RangetoHTML(rng) & "<br>"
[/pre]
Narayan
 
Try setting the item as a string first, and then setting HTML Body. Like so:

[pre]
Code:
Dim myString As String

myString = "Dear Team," & vbCrLf & vbCrLf _
& "Kindly find the update on MTD & YTD Unit Wise Performance as on " & dt & " "
.HTMLBody = myString
[/pre]
 
Hi, Supriya!

I join Luke M's suggestion. If it doesn't work would you please upload a sample file?

Regards!
 
Hi ,


Thanks to all who help me.

thank you so much

i was tried
& is working now my macro.


Regards,

supriya
 
@Supriya,

Do you have additional questions? You previous post seemed to indicate that the problem was resolved.
 
Hi Luke,


Yes problem has been resolved.

I have one more question...

i want to change font name & size in mail

Actually my mail's contents are in Calibri font of size 10.

but for below

.HTMLBody = "Dear Team," & vbCrLf & vbCrLf _

& "Kindly find the update on MTD & YTD Unit Wise Performance as on " & DT & " " & vbCrLf _

& RangetoHTML(rng) & vbCrLf _


the text display in Arial font of size 11.

Pl help mw to solve this


Supriya.
 
Hi Supriya,


SInce the forum is migrating soon, I suggest you repost this question after the move to prevent the answer from being lost. See you on the other side. =)


http://chandoo.org/forums/topic/forum-migration-freezing-on-23aug2013-important
 
Back
Top