ich möchte gerne per Makro Rahmen setzen. Dabei sollen die letzte benutzte Zeile und Spalte ermittelt werden. Mein Ansatz:
Sub zeilenhoehe()
On Error GoTo nix
Application.ScreenUpdating = False
Dim Hoehe As String
Dim Ende As Long
letztezeile = ActiveSheet.Cells(65536, 1).End(xlUp).Row
Ende = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Column
Hoehe = InputBox("Welche Höhe?")
If Not IsNumeric(Hoehe) Then Exit Sub
With ActiveSheet.Range("A1:" & Replace(Cells(1, Selection.Column).Address(0, 0), "1", "")& Ende _
& letztezeile)
'Diese beiden Zeilen darüber sind falsch. Wie müssten sie richtig lauten?
With .Borders
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15 'grau
End With
End With
Application.ScreenUpdating = True
nix:
End Sub
Hilfe wäre nett.Grüße Burghard