PDA

View Full Version : autosize a comment



lior03
08-23-2006, 09:22 PM
hello
can anyone suggest a code for autosizing comments?
thanks

Emily
08-23-2006, 09:49 PM
Comment resize by area


For Each cmt In ActiveSheet.Comments
With cmt
If Not Intersect(.Parent, Selection) Is Nothing Then
.Shape.TextFrame.AutoSize = True
If .Shape.Width > 300 Then
lArea = .Shape.Width * .Shape.Height
.Shape.Width = 300
.Shape.Height = (lArea / 300) * 1.2
End If
End If
End With
Next

lostin_space
08-24-2006, 08:08 AM
where do you drop this code??? into the 'this workbook' module?

Emily
08-24-2006, 09:00 AM
I placed in a standard module