In meiner Excel-Liste wird die Zeilenhöhe automatisch nach dem größten Zelleninhalt angepasst. Das ist auch soweit super.
Aber: Kann ich die automatische Zeilenhöhe auf max. 250 Pixel begrenzen?
Gruß
Christian
With Rows("3:3")
.AutoFit
If .Height > 187.5 Then '187.5 entspricht 250 pixel
.RowHeight = 187.5
End If
End With
Gruß
' Automatische Zeilenhöhe
With Rows("6:2500")
.AutoFit
If .Height > 187.5 Then '187.5 entspricht 250 pixel
.RowHeight = 187.5
End If
End With
Gruß
for i = 6 to 2500
' Automatische Zeilenhöhe
With Rows(i) 'oder Rows(i & ":" i)
.AutoFit
If .Height > 187.5 Then '187.5 entspricht 250 pixel
.RowHeight = 187.5
End If
End With
next i
Gruß
for i = 6 to 2500
' Automatische Zeilenhöhe
With Rows(i)
.AutoFit
If .Height > 187.5 Then '187.5 entspricht 250 pixel
.RowHeight = 187.5
End If
End With
next i
schreibe, dann läuft das Makro und hört nicht mehr auf!for i = 6 to 2500
' Automatische Zeilenhöhe
With Rows(i & ":" i)
.AutoFit
If .Height > 187.5 Then '187.5 entspricht 250 pixel
.RowHeight = 187.5
End If
End With
next i
bekomme ich einen Syntaxfehler... :-/
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row >= 6 And Target.Row 187.5 Then '187.5 entspricht 250 pixel
.RowHeight = 187.5
End If
End With
End If
End Sub
Gruß Hajo