Ich brauche mal wieder eure Hilfe.
In einer Datei befinden sich ca. 9 verschiedene Pivot-Tabellen. Diese sollen alle die gleiche Formatierung (Rahmen) haben, welche allerdings immer bei der Aktualisierung verschwindet.
Nun wollte ich das ganze per Makro lösen. Leider kommt immer wieder ein Fehler und ich finde den Fehler einfach nicht. Danke für eure Hilfe und Unterstüztung schon vor ab.
Thomas H.
Sub Test()
Dim piv As PivotTable
For Each piv In ActiveSheet.PivotTables
piv.Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = 1
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = 1
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = 1
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = 1
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = 1
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = 1
End With
Next
Range("B:E,G:J").ColumnWidth = 12
Range("F:F,K:K").ColumnWidth = 8
End Sub