ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I insert a preformated paragraph into a comment? (https://www.excelbanter.com/excel-programming/331389-how-do-i-insert-preformated-paragraph-into-comment.html)

Mark

How do I insert a preformated paragraph into a comment?
 
Hi,

I would like to insert a standardized paragraph into a comment.
The text would be something like:
"Work: (actions)
Part: (materials)
Data: (information used in calculations)"

Consider the following code:
If ct Is Nothing Then
ActiveCell.AddComment
Set ct = ActiveCell.Comment
'text
ct.Text "Work: (actions){enter}Part: (materials){enter}Data:
(information used in calculations)"
End If

Obviously {enter} is not working to add the carriage return that I am
looking for.

Thanks!
Mark

STEVE BELL

How do I insert a preformated paragraph into a comment?
 
"Text1" & variableText & vbcrlf & ......

"Text1" & variableText & chr(10) & ......

--
steveB

Remove "AYN" from email to respond
"Mark" wrote in message
...
Hi,

I would like to insert a standardized paragraph into a comment.
The text would be something like:
"Work: (actions)
Part: (materials)
Data: (information used in calculations)"

Consider the following code:
If ct Is Nothing Then
ActiveCell.AddComment
Set ct = ActiveCell.Comment
'text
ct.Text "Work: (actions){enter}Part: (materials){enter}Data:
(information used in calculations)"
End If

Obviously {enter} is not working to add the carriage return that I am
looking for.

Thanks!
Mark





All times are GMT +1. The time now is 12:38 AM.

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