Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VBA to format Excel comments 1

Status
Not open for further replies.

melone

Electrical
Joined
Aug 10, 2001
Messages
1,233
Location
US
Currently, I have a spreadsheet that puts comments on a group of cells. However, I want to change the font (size and bold) and also use the Autosize feature for the comment (textbox). I tried recording a macro and manually changing the comment properties. However, when I use the recorded code in my subroutine, I either get an error, or modify the cell properties (not the comment associated to the cell).

While searching the internet, it appears that the only way to accomplish this is to change the "Tooltip" configuration for the Windows enviornment. This seems absurd to me, and am hoping someone can point me in the right direction.

Thanks!
 
No sooner had I posted this question, that I found the answer (of course). Here is a sample of the my code for anyone that is interested.

With Sheet4.Cells(Row, Col).AddComment
.Visible = False
.Text comment
End With
With ActiveCell.comment.Shape.TextFrame.Characters.font
.Size = Font_Size
.Bold = True
End With
With ActiveCell.comment.Shape.TextFrame
.AutoSize = True
End With
 
Good work on your own question.

Funny enough I was just about to post a similar question - about the resizing. I'll try out your code.

Thanks
Mogens
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top