Simplification code bordure

Citaro

XLDnaute Occasionnel
Bonjour au forum,
Avez vous une idée pour simplifier ce code qui à la validation d'un userform fait une bodure sur la nouvelle ligne de donnée

Merci
Citaro

Range([A65536].End(xlUp), [A65536].End(xlUp).Offset(0, 11)).Select
With Selection.Borders(xlDiagonalDown).LineStyle = xlNone
End With
With Selection.Borders(xlDiagonalUp).LineStyle = xlNone
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.Weight = xlThin
End With
 
Dernière édition:

Pierrot93

XLDnaute Barbatruc
Re : Simplification code bordure

Bonjour,

essaye peut être ceci :
Code:
With Range([A65536].End(xlUp), [A65536].End(xlUp).Offset(0, 11))
    With .Borders
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    .Borders(xlDiagonalDown).LineStyle = xlNone
    .Borders(xlDiagonalUp).LineStyle = xlNone
End With

ou peut être cela :
Code:
With Range([A65536].End(xlUp), [A65536].End(xlUp).Offset(0, 11)).Borders
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
End With

bonne journée
@+
 

Discussions similaires

Statistiques des forums

Discussions
312 328
Messages
2 087 319
Membres
103 515
dernier inscrit
Cherbil12345