Gruppe
Allgemein
Problem
Die Länge und Höhe des Textes (abhängig von Schriftart und Größe) soll ausgelesen werden.
StandardModule: Modul1
Sub GetLengthHeight()
Dim shp As Shape
Dim dWidth As Double, dHeight As Double
Application.ScreenUpdating = False
dWidth = Columns(1).ColumnWidth
dHeight = Rows(1).RowHeight
Columns(1).AutoFit
Rows(1).AutoFit
Range("A1").CopyPicture Appearance:=xlScreen, Format:=xlBitmap
ActiveSheet.Paste
Set shp = ActiveSheet.Shapes(2)
MsgBox "Breite: " & shp.Width & vbLf & "Höhe: " & shp.Height
shp.Delete
Columns(1).ColumnWidth = dWidth
Rows(1).RowHeight = dHeight
Application.ScreenUpdating = True
End Sub