View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Get text metrics of fonts?

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.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2