Auto resize a comment box

Shadow123

Board Regular
Joined
Aug 20, 2012
Messages
124
Hi all,

I have been messing with my code for a few days, and I'm just workign on the the presentation now. The code below works except for the resize of the comment box...

I tried recording it, and it gave me the below, but I want to make it automatic if i can. Failing that Id like to set all comment boxes in the sheet to the below sizes (rather than one at a time)
Code:
    Selection.ShapeRange.ScaleWidth 1.05, msoFalse, msoScaleFromTopLeft
    Selection.ShapeRange.ScaleHeight 1.33, msoFalse, msoScaleFromTopLeft


Code:
   If MktCP = test Then
       With .Cells(r - 1, -15)
           '.Value = cell.Offset(, -12).Value
                 Set Cmt = .Comment
                   If Cmt Is Nothing Then
                      .AddComment Text:=cell.Offset(, -12).Value & " @ " & cell.Offset(, -6).Value
                        .Shape.TextFrame.AutoSize = True  'this line not working

                        Else
                                   
                         Cmt.Text Text:=Cmt.Text & " " & cell.Offset(, -12).Value & r & " "
                        .Shape.TextFrame.AutoSize = True 'this line not working

                       End If
             End With
             Else
            End If

Any help?
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
sigh, i googled all over for that, guess i should of added looked further. Thats done it, thanks very much.
 
Upvote 0

Forum statistics

Threads
1,214,851
Messages
6,121,931
Members
449,056
Latest member
denissimo

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