How to append text to comment in Excel VBA?

不打扰是莪最后的温柔 提交于 2020-02-02 10:56:16

问题


I have a VBA script that appends text to any cell's comment, however it removes all comment formatting.

My current code is as simple as

c.Comment.text "something to append" & " " & c.Comment.text

Is it possible to do this job, but without losing all comment's formatting.


回答1:


As documented, the Text method has three parameters.
Use all three to keep existing text:

c.Comment.Text "something to append ", 1, False



回答2:


Be very careful when using the Characters functions because there are ancient bugs in Excel and I have found that this can cause instability and unreproduceable crashes if used with large workbook.



来源:https://stackoverflow.com/questions/30696807/how-to-append-text-to-comment-in-excel-vba

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!