1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
Dim PT As Range, C As Range
If Res <> "" Then
With Range(Res)
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
End With
End If
Set PT = Union(Target.DataLabelRange, Target.DataBodyRange, Target.PivotFields("Nom").DataRange, _
Target.PivotFields("Ville").DataRange, Target.PivotFields("Date").DataRange)
PT.Select
For Each C In PT
C.BorderAround xlContinuous, xlMedium
Next C
Res = Target.TableRange2.Address
End Sub |