general question about measuring text inside comment boxes...

sadams1

Board Regular
Joined
Aug 19, 2006
Messages
228
In Word, you can the ruler to see measurements of tabs, indents & spacing. I know that the comment boxes in Excel do not have that capability. However, I'm fairly certain I have seen VBA code that does show measurements like this within comment boxes. Is there a "reveal codes" for text in comment boxes anything like this?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
You can determine the size of a comment shape with a basic macro like this, assuming your comment is in cell A1:

Code:
Sub CommentSize()
With Range("A1").Comment.Shape
MsgBox "Height: " & .Height & vbCrLf & "Width: " & .Width, , "Comment size:"
End With
End Sub

Comment shapes are of the Points unit of measurement.
For example, one inch equals 72 points.
 
Upvote 0
Hey sadams1

OK, I am not sure I understand your question properly. By “measurement” you mean how much “space” that string will occupy? Or do you mean the number of characters in the string?

If you need the count of characters in a string look into the LEN() Function.

If you mean the “space” the string will occupy, I am afarid, as I understand things, there are other variables in play here. One major one will be the font used. Courier New is a font that uses the same “space” for all characters. The I and the H occupy the same space. There is a technical term to describe that kind of font, but I am drawing a blank right now.

If you are interested take a peek at https://creativemarket.com/blog/10-fascinating-scientific-facts-about-fonts or search using “all about fonts”

Hope this helps.
 
Upvote 0

Forum statistics

Threads
1,224,760
Messages
6,180,817
Members
452,997
Latest member
gimamabe71

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