Option Explicit
Sub rahmen()
Dim U As Range
ActiveWindow.DisplayGridlines = False
Set U = Range(Cells(1, 1), Cells(leZeile, leSpalte))
With U.Cells.Borders
.LineStyle = xlDot
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub
Function leZeile() As Long
leZeile = CLng(Range(Range("A:IV").Find(What:="*", _
After:=Range("A65536"), LookIn:=xlValues, LookAt:=xlWhole, _
SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Address).Row)
End Function
Function leSpalte() As Integer
leSpalte = CInt(Range(Range("A:IV").Find(What:="*", After:=Range("IV1"), _
LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious).Address).Column)
End Function
Code eingefügt mit: Excel Code Jeanie