Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to append text to comment in Excel VBA?

Tags:

excel

vba

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.

like image 590
Maciej Szpakowski Avatar asked Apr 21 '26 05:04

Maciej Szpakowski


1 Answers

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

c.Comment.Text "something to append ", 1, False
like image 71
GSerg Avatar answered Apr 23 '26 06:04

GSerg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!