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;
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
add a comment |
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
1
There are two statements on the same line. Try justC.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 addedC.COMMENT.Shape.TextFrame.AutoSize = Trueand it worked. Thank you so much.
– Steven Gilbert
Mar 27 at 12:49
add a comment |
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
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
excel vba
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 justC.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 addedC.COMMENT.Shape.TextFrame.AutoSize = Trueand it worked. Thank you so much.
– Steven Gilbert
Mar 27 at 12:49
add a comment |
1
There are two statements on the same line. Try justC.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 addedC.COMMENT.Shape.TextFrame.AutoSize = Trueand 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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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 = Trueand it worked. Thank you so much.– Steven Gilbert
Mar 27 at 12:49