Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default force a line break in a comment

Dear experts,
I have a macro that generates cell comments. Since some of
them are quite long, I would like to force a line break.
I tried to use the following:
Msg1 = "No data for this product/ probably it" & vbCrLf
Msg1 = Msg1 & "was not being used yet in this quarter"
Workbooks(Product).Worksheets(1).Cells(i, z).AddComment
Msg1

But what I have in return is a linebreak plus a square
symbol (the one Excel uses when not able to identify a
character).
Can you please help me forcing a line break in my comments?
Many thanks!
Kind regards,
Valeria
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default force a line break in a comment

Hi Valeria,

Try vbLF instead of vbCrLf.


Regards,
Shah Shailesh
http://members.lycos.co.uk/shahweb/
(Excel Add-ins)


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default force a line break in a comment

At the point you want to insert a line break you have to
insert Chr(10)
Example
Range("F9").Comment.Text Text:="Abcde" & Chr(10)
& "fghijk" & Chr(10) & "lmnop"

Regards
Klaus

-----Original Message-----
Dear experts,
I have a macro that generates cell comments. Since some

of
them are quite long, I would like to force a line break.
I tried to use the following:
Msg1 = "No data for this product/ probably it" & vbCrLf
Msg1 = Msg1 & "was not being used yet in this quarter"
Workbooks(Product).Worksheets(1).Cells(i, z).AddComment
Msg1

But what I have in return is a linebreak plus a square
symbol (the one Excel uses when not able to identify a
character).
Can you please help me forcing a line break in my

comments?
Many thanks!
Kind regards,
Valeria
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Force Page Break in Excel? NicoleS Excel Discussion (Misc queries) 4 January 16th 09 04:33 PM
Force a comment before exiting a cell Bob Excel Worksheet Functions 1 June 6th 08 05:40 PM
Force line break based on text Quizologist Excel Discussion (Misc queries) 3 June 4th 08 05:46 PM
Break cell into multiple lines by line break Chia Excel Discussion (Misc queries) 1 August 20th 06 06:37 AM
Force Page Break Eugenia Excel Discussion (Misc queries) 1 March 18th 05 07:23 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"