ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding comment text - linefeed visible - why? (https://www.excelbanter.com/excel-programming/378509-adding-comment-text-linefeed-visible-why.html)

What-A-Tool

Adding comment text - linefeed visible - why?
 
Adding a comment to a cell - no matter what I use for a line feed, I either
end up with a bar or a box displayed in my comment text in the location of
my line feed charecter. I have tried Chr(13), vbNewLine, vbCrLf, all with
the same result.
Can anyone tell me how I can get a line feed in my comment text without the
line feed charecter showing?

Thanks in advance - Sean

Following is my code :

strText = strAuthor & " " & vbCrLf
strText = strText & mstrDayStrt & Format(strDayStart, "h:mm AM/PM")
strText = strText & " " & vbCrLf
strText = strText & mstrDayEnd & Format(strDayEnd, "h:mm AM/PM")

ActiveSheet.Range(strComRng).ClearComments
With ActiveSheet.Range(strComRng).AddComment
.Visible = False
.Text strText
End With

The added spaces are just to get that displayed linefeed charecter away from
my text - makes it look a little better.



What-A-Tool

Adding comment text - linefeed visible - why?
 
Thought I had also tried vbLF - I was wrong - it worked and did what I
wanted without displaying any unsightly bars or boxes.
Thanks for the tip
Sean


wrote in message
oups.com...
Hi Sean,

Have you also tried Chr(10) or vbLf?

Regards,
Steve

What-A-Tool wrote:
Adding a comment to a cell - no matter what I use for a line feed, I
either
end up with a bar or a box displayed in my comment text in the location
of
my line feed charecter. I have tried Chr(13), vbNewLine, vbCrLf, all with
the same result.
Can anyone tell me how I can get a line feed in my comment text without
the
line feed charecter showing?

Thanks in advance - Sean

Following is my code :

strText = strAuthor & " " & vbCrLf
strText = strText & mstrDayStrt & Format(strDayStart, "h:mm AM/PM")
strText = strText & " " & vbCrLf
strText = strText & mstrDayEnd & Format(strDayEnd, "h:mm AM/PM")

ActiveSheet.Range(strComRng).ClearComments
With ActiveSheet.Range(strComRng).AddComment
.Visible = False
.Text strText
End With

The added spaces are just to get that displayed linefeed charecter away
from
my text - makes it look a little better.





[email protected]

Adding comment text - linefeed visible - why?
 
Hi Sean,

Have you also tried Chr(10) or vbLf?

Regards,
Steve

What-A-Tool wrote:
Adding a comment to a cell - no matter what I use for a line feed, I either
end up with a bar or a box displayed in my comment text in the location of
my line feed charecter. I have tried Chr(13), vbNewLine, vbCrLf, all with
the same result.
Can anyone tell me how I can get a line feed in my comment text without the
line feed charecter showing?

Thanks in advance - Sean

Following is my code :

strText = strAuthor & " " & vbCrLf
strText = strText & mstrDayStrt & Format(strDayStart, "h:mm AM/PM")
strText = strText & " " & vbCrLf
strText = strText & mstrDayEnd & Format(strDayEnd, "h:mm AM/PM")

ActiveSheet.Range(strComRng).ClearComments
With ActiveSheet.Range(strComRng).AddComment
.Visible = False
.Text strText
End With

The added spaces are just to get that displayed linefeed charecter away from
my text - makes it look a little better.




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

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