Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I am programming a userform to input and edit records in a spreadsheet. I have a couple of textboxes in the form that I am using to add comment boxes to certain cells. I am trying to find a way to set the comment boxes format to automatic size within the userform's code. This way long comments will be entirely visible when the mouse hovers over the comment. Any help or suggestions would be very helpful. Thanks, -Brandon |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is a function you can use to auto size cell comments (copy to standard
code module): Public Function CommentAutoSizeRange(argAddress As Range) 'FUNCTION AUTO-SIZES THE COMMENT IN THE CELL SUPPLIED; argAddress.Comment.Visible = True argAddress.Comment.Shape.Select True Selection.AutoSize = True argAddress.Comment.Visible = False End Function Call the above like so: Private Sub CommandButton1_Click() Dim rngCell As Range Set rngCell = ActiveCell Call CommentAutoSizeRange(rngCell) End Sub This function resizes all comments in the sheet: Public Function CommentsAutoSizeAll() 'AUTO-SIZE ALL COMMENTS IN THE ACTIVESHEET; Dim cmt As Comment Dim cmts As Comments Set cmts = ActiveSheet.Comments For Each cmt In cmts cmt.Shape.TextFrame.AutoSize = True Next End Function HTH "Brandon" wrote: Hello, I am programming a userform to input and edit records in a spreadsheet. I have a couple of textboxes in the form that I am using to add comment boxes to certain cells. I am trying to find a way to set the comment boxes format to automatic size within the userform's code. This way long comments will be entirely visible when the mouse hovers over the comment. Any help or suggestions would be very helpful. Thanks, -Brandon |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2003 Programming | Excel Discussion (Misc queries) | |||
Programming Comments from the inside!! Asistance Please | Excel Programming | |||
Excel 2003 & add-in programming | Excel Programming | |||
programming excel 97 from .net 2003 | Excel Programming | |||
Programming in Excel 2003! | Excel Programming |