Sub Encadrer(Taille As Integer)
ActiveCell.Range("A1:A" & Taille).Select
Set isect = Application.Intersect(ActiveCell.Range("A1:A" & Taille), Range("B12:F12"))
If Not isect Is Nothing Then
MsgBox ("Attention vous allez modifier une Formule")
Else
Set isect = Application.Intersect(ActiveCell.Range("A1:A" & Taille), Range("B2:F" & (12 - Taille)))
If Not isect Is Nothing Then
selection.Borders(xlDiagonalDown).LineStyle = xlNone
selection.Borders(xlDiagonalUp).LineStyle = xlNone
With selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
selection.Borders(xlInsideHorizontal).LineStyle = xlNone
ActiveCell.FormulaR1C1 = Taille
End If
End If
ActiveCell.Range("A1").Select
End Sub