AW: Tabelle nur für beschriebenen Bereich
04.02.2008 15:32:19
Rudi
Hallo,
Sub DrawBorder()
Dim lastRow As Long, startCol As Integer, startRow As Integer, endCol As Integer
startCol = 1 'Spalte A
startRow = 10 'Zeile 10
endCol = 5 'Spalte E
lastRow = Cells(Rows.Count, endCol).End(xlUp).Row
With Range(Cells(startRow, startCol), Cells(lastRow, endCol))
'Alte Rahmen entfernen
.Borders.LineStyle = xlNone
With .Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With .Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End With
End Sub
Gruß
Rudi
Eine Kuh macht Muh, viele Kühe machen Mühe