Another question about comment

Excelboo2

Board Regular
Joined
Oct 11, 2006
Messages
175
I have written the following scripts:

For I = 1 to 10
Cells(I,1).AddComment
Cells(I, 1).Comment.Text Text:="ABC "
Cells(I, 1).Comment.ShapeRange.ScaleHeight 0.33, msoFalse, msoScaleFromTopLeft

Next I

I want to change the size of the comment box and the size of text inside the comment box but it doesn’t work. Please help. Many Thanks
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
The comment is considered a shape. More specifically a rectangle. If you have "Rectangles" in your worksheet that are not comments, the code below will alter those too.

You may have to test additional properties to single out only "Comment Rectangles". Testing the fill, or background, color is the first thing that comes to mind.

Hope it helps.

Gary

Code:
Dim oShape As Shape

For Each oShape In ActiveSheet.Shapes
    If oShape.AutoShapeType = msoShapeRectangle Then
        oShape.Width = 200
        oShape.Height = 100
        oShape.TextFrame.Characters.Font.Size = 16
    End If
Next
 
Upvote 0

Forum statistics

Threads
1,214,430
Messages
6,119,447
Members
448,898
Latest member
drewmorgan128

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top