How to auto-size comment box to fit its content?excel vba get range of user selected range by mouse and copy it to clipboardprogrammatically excel cells to be auto fit width & heightExcel VBA - read cell value from codehow to prevent re sizing of buttons after release of auto filter in excel 2010 using vbaHow to fit range of calculate calomn to pivot table size in Excel 2013Copy only selected table columns after filter to new worksheetChange comment size relative to original size of fill picture in Excel vbaHow to auto-size Excel comment?Excel VBA macro to send emails to unique users in range

Why force the nose of 737 Max down in the first place?

What is more environmentally friendly? An A320 or a car?

Exploiting the delay when a festival ticket is scanned

Is SecureRandom.ints() secure?

Who said "one can be a powerful king with a very small sceptre"?

Why is my fluorescent tube orange on one side, white on the other and dark in the middle?

Can Papyrus be folded?

Why does the Eurostar not show youth pricing?

Problem with Eigenvectors

How should I quote American English speakers in a British English essay?

How did the SysRq key get onto modern keyboards if it's rarely used?

Is there an antonym(a complementary antonym) for "spicy" or "hot" regarding food (I DO NOT mean "seasoned" but "hot")?

Does dual boot harm a laptop battery or reduce its life?

What is the general way to say something like "in your room?" without a verb?

How to season a character?

Why does aggregate initialization not work anymore since C++20 if a constructor is explicitly defaulted or deleted?

Omnidirectional LED, is it possible?

Self-deportation of American Citizens from US

Why did House of Representatives need to condemn Trumps Tweets?

Assuring luggage isn't lost with short layover

Is there any app for reduce battery draining for ios 12?

How to improve king safety

Do 3/8 (37.5%) of Quadratics Have No x-Intercepts?

How did "ordnance" lose the "i"?



How to auto-size comment box to fit its content?


excel vba get range of user selected range by mouse and copy it to clipboardprogrammatically excel cells to be auto fit width & heightExcel VBA - read cell value from codehow to prevent re sizing of buttons after release of auto filter in excel 2010 using vbaHow to fit range of calculate calomn to pivot table size in Excel 2013Copy only selected table columns after filter to new worksheetChange comment size relative to original size of fill picture in Excel vbaHow to auto-size Excel comment?Excel VBA macro to send emails to unique users in range






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am trying to turn the text contents of a single cell into a comment on that cell and then have the comment auto size to fit the true size of the contents. I found two separate macros that work but I am having trouble combining them into one macro.



The below code works by converting the selected cell into a comment.
https://sumtips.com/tips-n-tricks/convert-excel-cell-contents-comments-vba/



Sub ConvertToComment()
Dim C As Range
For Each C In Selection
C.ClearComments
If Len(C.Value) > 0 Then
C.AddComment
C.COMMENT.Text C.Value & ""
End If
'Optional: Delete cell content after converting
C = "See Comment"
Next C
End Sub


The below code works in auto sizing all the comments on the sheet.
https://quadexcel.com/how-to-auto-size-comment-box-to-fit-its-content-in-excel/



Sub FitComments()
Dim xComment As Comment
For Each xComment In Application.ActiveSheet.Comments
xComment.Shape.TextFrame.AutoSize = True
Next
End Sub


How can I incorporate the below line into the ConvertToComment() macro at the top?



xComment.Shape.TextFrame.AutoSize = True


The below code is my sad attempt to add a line I think is important to make it work the way I want it to. Create the comment and Autosize the created comment to fit the content. I am still very new to VBA.



Sub ConvertToComment()
Dim C As Range
Dim xComment As COMMENT
For Each C In Selection
C.ClearComments
If Len(C.Value) > 0 Then
C.AddComment
C.COMMENT.Text C.Value & ""
--> COMMENT.Text C.Shape.TextFrame.AutoSize = True
End If
'Optional: Delete cell content after converting
C = "See Comment"
Next C
End Sub


Error Message "Object doesn't support this project or method"










share|improve this question





















  • 1





    There are two statements on the same line. Try just C.Shape.TextFrame.AutoSize = True

    – PeterT
    Mar 26 at 21:06






  • 1





    Thank you for the response. I have just tried this line in the place of my previous incorrect line. It gave error 438. "Object doesn't support this property or method". So I added C.COMMENT.Shape.TextFrame.AutoSize = True and it worked. Thank you so much.

    – Steven Gilbert
    Mar 27 at 12:49


















0















I am trying to turn the text contents of a single cell into a comment on that cell and then have the comment auto size to fit the true size of the contents. I found two separate macros that work but I am having trouble combining them into one macro.



The below code works by converting the selected cell into a comment.
https://sumtips.com/tips-n-tricks/convert-excel-cell-contents-comments-vba/



Sub ConvertToComment()
Dim C As Range
For Each C In Selection
C.ClearComments
If Len(C.Value) > 0 Then
C.AddComment
C.COMMENT.Text C.Value & ""
End If
'Optional: Delete cell content after converting
C = "See Comment"
Next C
End Sub


The below code works in auto sizing all the comments on the sheet.
https://quadexcel.com/how-to-auto-size-comment-box-to-fit-its-content-in-excel/



Sub FitComments()
Dim xComment As Comment
For Each xComment In Application.ActiveSheet.Comments
xComment.Shape.TextFrame.AutoSize = True
Next
End Sub


How can I incorporate the below line into the ConvertToComment() macro at the top?



xComment.Shape.TextFrame.AutoSize = True


The below code is my sad attempt to add a line I think is important to make it work the way I want it to. Create the comment and Autosize the created comment to fit the content. I am still very new to VBA.



Sub ConvertToComment()
Dim C As Range
Dim xComment As COMMENT
For Each C In Selection
C.ClearComments
If Len(C.Value) > 0 Then
C.AddComment
C.COMMENT.Text C.Value & ""
--> COMMENT.Text C.Shape.TextFrame.AutoSize = True
End If
'Optional: Delete cell content after converting
C = "See Comment"
Next C
End Sub


Error Message "Object doesn't support this project or method"










share|improve this question





















  • 1





    There are two statements on the same line. Try just C.Shape.TextFrame.AutoSize = True

    – PeterT
    Mar 26 at 21:06






  • 1





    Thank you for the response. I have just tried this line in the place of my previous incorrect line. It gave error 438. "Object doesn't support this property or method". So I added C.COMMENT.Shape.TextFrame.AutoSize = True and it worked. Thank you so much.

    – Steven Gilbert
    Mar 27 at 12:49














0












0








0


1






I am trying to turn the text contents of a single cell into a comment on that cell and then have the comment auto size to fit the true size of the contents. I found two separate macros that work but I am having trouble combining them into one macro.



The below code works by converting the selected cell into a comment.
https://sumtips.com/tips-n-tricks/convert-excel-cell-contents-comments-vba/



Sub ConvertToComment()
Dim C As Range
For Each C In Selection
C.ClearComments
If Len(C.Value) > 0 Then
C.AddComment
C.COMMENT.Text C.Value & ""
End If
'Optional: Delete cell content after converting
C = "See Comment"
Next C
End Sub


The below code works in auto sizing all the comments on the sheet.
https://quadexcel.com/how-to-auto-size-comment-box-to-fit-its-content-in-excel/



Sub FitComments()
Dim xComment As Comment
For Each xComment In Application.ActiveSheet.Comments
xComment.Shape.TextFrame.AutoSize = True
Next
End Sub


How can I incorporate the below line into the ConvertToComment() macro at the top?



xComment.Shape.TextFrame.AutoSize = True


The below code is my sad attempt to add a line I think is important to make it work the way I want it to. Create the comment and Autosize the created comment to fit the content. I am still very new to VBA.



Sub ConvertToComment()
Dim C As Range
Dim xComment As COMMENT
For Each C In Selection
C.ClearComments
If Len(C.Value) > 0 Then
C.AddComment
C.COMMENT.Text C.Value & ""
--> COMMENT.Text C.Shape.TextFrame.AutoSize = True
End If
'Optional: Delete cell content after converting
C = "See Comment"
Next C
End Sub


Error Message "Object doesn't support this project or method"










share|improve this question
















I am trying to turn the text contents of a single cell into a comment on that cell and then have the comment auto size to fit the true size of the contents. I found two separate macros that work but I am having trouble combining them into one macro.



The below code works by converting the selected cell into a comment.
https://sumtips.com/tips-n-tricks/convert-excel-cell-contents-comments-vba/



Sub ConvertToComment()
Dim C As Range
For Each C In Selection
C.ClearComments
If Len(C.Value) > 0 Then
C.AddComment
C.COMMENT.Text C.Value & ""
End If
'Optional: Delete cell content after converting
C = "See Comment"
Next C
End Sub


The below code works in auto sizing all the comments on the sheet.
https://quadexcel.com/how-to-auto-size-comment-box-to-fit-its-content-in-excel/



Sub FitComments()
Dim xComment As Comment
For Each xComment In Application.ActiveSheet.Comments
xComment.Shape.TextFrame.AutoSize = True
Next
End Sub


How can I incorporate the below line into the ConvertToComment() macro at the top?



xComment.Shape.TextFrame.AutoSize = True


The below code is my sad attempt to add a line I think is important to make it work the way I want it to. Create the comment and Autosize the created comment to fit the content. I am still very new to VBA.



Sub ConvertToComment()
Dim C As Range
Dim xComment As COMMENT
For Each C In Selection
C.ClearComments
If Len(C.Value) > 0 Then
C.AddComment
C.COMMENT.Text C.Value & ""
--> COMMENT.Text C.Shape.TextFrame.AutoSize = True
End If
'Optional: Delete cell content after converting
C = "See Comment"
Next C
End Sub


Error Message "Object doesn't support this project or method"







excel vba






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 20:34









Ahmed Abdelhameed

7,6158 gold badges25 silver badges51 bronze badges




7,6158 gold badges25 silver badges51 bronze badges










asked Mar 26 at 20:31









Steven GilbertSteven Gilbert

121 silver badge6 bronze badges




121 silver badge6 bronze badges










  • 1





    There are two statements on the same line. Try just C.Shape.TextFrame.AutoSize = True

    – PeterT
    Mar 26 at 21:06






  • 1





    Thank you for the response. I have just tried this line in the place of my previous incorrect line. It gave error 438. "Object doesn't support this property or method". So I added C.COMMENT.Shape.TextFrame.AutoSize = True and it worked. Thank you so much.

    – Steven Gilbert
    Mar 27 at 12:49













  • 1





    There are two statements on the same line. Try just C.Shape.TextFrame.AutoSize = True

    – PeterT
    Mar 26 at 21:06






  • 1





    Thank you for the response. I have just tried this line in the place of my previous incorrect line. It gave error 438. "Object doesn't support this property or method". So I added C.COMMENT.Shape.TextFrame.AutoSize = True and it worked. Thank you so much.

    – Steven Gilbert
    Mar 27 at 12:49








1




1





There are two statements on the same line. Try just C.Shape.TextFrame.AutoSize = True

– PeterT
Mar 26 at 21:06





There are two statements on the same line. Try just C.Shape.TextFrame.AutoSize = True

– PeterT
Mar 26 at 21:06




1




1





Thank you for the response. I have just tried this line in the place of my previous incorrect line. It gave error 438. "Object doesn't support this property or method". So I added C.COMMENT.Shape.TextFrame.AutoSize = True and it worked. Thank you so much.

– Steven Gilbert
Mar 27 at 12:49






Thank you for the response. I have just tried this line in the place of my previous incorrect line. It gave error 438. "Object doesn't support this property or method". So I added C.COMMENT.Shape.TextFrame.AutoSize = True and it worked. Thank you so much.

– Steven Gilbert
Mar 27 at 12:49













0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55365754%2fhow-to-auto-size-comment-box-to-fit-its-content%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid …


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55365754%2fhow-to-auto-size-comment-box-to-fit-its-content%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?