ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sub to write cell contents into its own comment (https://www.excelbanter.com/excel-programming/433127-sub-write-cell-contents-into-its-own-comment.html)

Max

Sub to write cell contents into its own comment
 
I would select a range of cells, then run the sub to write each cell's
content into its own comment. The sub to do nothing for any cell within the
selection which is blank. For cells which contain formulas, to write the
returned values into the comment. Thanks for insights

Jacob Skaria

Sub to write cell contents into its own comment
 
Try the below

Sub Macro()
On Error Resume Next
For Each cell In Selection
If cell.Text < "" Then _
cell.AddComment cell.Text
Next
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"Max" wrote:

I would select a range of cells, then run the sub to write each cell's
content into its own comment. The sub to do nothing for any cell within the
selection which is blank. For cells which contain formulas, to write the
returned values into the comment. Thanks for insights


Max

Sub to write cell contents into its own comment
 
Fantastic! Works great, Jacob. Thanks


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

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