Hallo,
Habe eine Tabelle in Excel die in A2 startet, die Spalten A - F umfasst und nach unten hin variabel ist (variable Zeilenanzahl)
Möchte diese Tabelle über VBA formatieren: Rahmen setzten.
Mein bisheriger VBA-Versuch:
Sub Rahmen()
Set Bereich = ActiveSheet.UsedRange
With Bereich.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Bereich.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Bereich.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Bereich.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Bereich.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Bereich.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub
Steh jetzt auf dem Schlauch, da so von A1 startend alles formatiert wird, ich möchte aber wie gesagt fest legen wo die Formatierung starten soll.
Danke für eure Hilfe! |