commande bordure macro

B

boy569

Guest
Je cherche la commande pour mettre une bordure à l'aide d'une macro
merci
 
C

coyote

Guest
et je ne l'ai fait qu'en mode enregistrement
+ quelques commentaires en gras

Sub Macro1()
'
' Macro1 Macro
' Macro enregistrée le 26/01/2004 par home
'

'SELECTION C3 à E7
Range("C3:E7").Select

'BORD GAUCHE
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With

'BORD HAUT
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With

'BORD BAS
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
'BORD DROIT
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With

'pas de bordure intérieure verticale,horizontale ou diagonales
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
End Sub
 

Statistiques des forums

Discussions
314 162
Messages
2 106 604
Membres
109 639
dernier inscrit
Phil1860