Get text metrics of fonts?

R

Robert Crandal

Is it possible to get the font "text metrics" of charcters
typed in cells? It might be useful if I can find the
font width and height of each individual character in
a cell.

Thank you!
 
C

Claus Busch

Hi Robert,

Am Fri, 15 Nov 2013 01:55:00 -0700 schrieb Robert Crandal:
Is it possible to get the font "text metrics" of charcters
typed in cells? It might be useful if I can find the
font width and height of each individual character in
a cell.

characters has no with property. But you can read style and size:
Sub Test()
Dim i As Integer

For i = 1 To Len(Range("A1"))
With Range("A1").Characters(i, 1).Font
MsgBox .FontStyle & Chr(10) & .Size
End With
Next
End Sub


Regards
Claus B.
 
C

Claus Busch

hi again,

Am Fri, 15 Nov 2013 10:07:37 +0100 schrieb Claus Busch:
characters has no with property. But you can read style and size:
^^^^^^
characters.font has no WIDTH property


Regards
Claus B.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top