AW: Zellengrösse
08.04.2009 07:45:55
chris
Hallo das geht mit VBA so,
Sub zeilenhoehe()
Dim hoehe As Single, aktuell As Single, text As String, antwort As String
'aktuelle Zeilenhöhe ermitteln
aktuell = Selection.RowHeight / 29.5
'Text zur Ausgabe vorbereiten
text = "Aktuelle Zeilenhöhe: " & Format(aktuell, "###0.00 cm") & Chr(13) & "Geben Sie die gewü _
nschte Zeilenhöhe für die aktuelle Zeile oder Markierung in cm ein:"
'InputBox anzeigen
antwort = InputBox(text, "Neue Zeilenhöhe festlegen", Format(aktuell, "###0.00"))
'antwort auswerten und neue Zeilenhöhe setzen
If antwort "" Then
hoehe = CSng(antwort)
Selection.RowHeight = hoehe * 29.5
End If
End Sub
Sub spaltenbreite()
Dim breite As Single, aktuell As Single, text As String, antwort As String
'aktuelle Splatenbreite ermitteln
aktuell = (Selection.ColumnWidth + 0.71) / 5.1425
'Text zur Ausgabe vorbereiten
text = "Aktuelle Spaltenbreite: " & Format(aktuell, "###0.00 cm") & Chr(13) & "Geben Sie die _
gewünschte Spaltenbreite für die aktuelle Spalte oder Markierung in cm ein:"
'InputBox anzeigen
antwort = InputBox(text, "Neue Spaltenbreite festlegen", Format(aktuell, "###0.00"))
'antwort auswerten und neue Spaltenbreite setzen
If antwort "" Then
breite = CSng(antwort)
Selection.ColumnWidth = -0.71 + 5.1425 * breite
End If
End Sub
Erfolgreich ? Bitte um Rückmeldung
gruß Chris