ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying text from comments to cells with line feed (https://www.excelbanter.com/excel-programming/366591-copying-text-comments-cells-line-feed.html)

[email protected]

Copying text from comments to cells with line feed
 
I am having trouble finding a way of getting text from comments into a
cell, or even a text box, while preserving the line feeds. Ideally
this would be a UDF, but all of the example ones I can find that do
what I need do not handle line feeds. Any help?


colofnature[_81_]

Copying text from comments to cells with line feed
 

This works if you turn on text wrapping in the cell:

Function comment2cell(rTarget As Range) As String
comment2cell = rTarget.Comment.Text
End Function

Note that if rTarget doesn't have a comment or is 1 cell this return
#VALUE.

Co

--
colofnatur
-----------------------------------------------------------------------
colofnature's Profile: http://www.excelforum.com/member.php...fo&userid=3435
View this thread: http://www.excelforum.com/showthread.php?threadid=55939



All times are GMT +1. The time now is 03:02 PM.

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