Sub ajout1()
Dim cellFind As Range
Set cellFind = Range("A:A").Find("Sub-total/ Sous total", , xlValues, xlWhole)
If Not cellFind Is Nothing Then
Rows(cellFind.Row - 1).Insert
MiseEnFormeTableau Range(Cells(10, 1), Cells(cellFind.Row - 2, 4))
End If
End Sub
Sub ajout2()
Dim cellFind As Range, i As Integer
Set cellFind = Range("A:A").Find("Sub-total/ Sous total", , xlValues, xlWhole)
If Not cellFind Is Nothing Then i = cellFind.Row + 5
Set cellFind = Range("A:A").FindNext(cellFind)
If Not cellFind Is Nothing Then
Rows(cellFind.Row - 1).Insert
If Not i = Empty Then MiseEnFormeTableau Range(Cells(i, 1), Cells(cellFind.Row - 2, 4))
End If
End Sub
Sub ajout3()
Dim cellFind As Range
Set cellFind = Range("A:A").Find("Sub-total/ Sous total", , xlValues, xlWhole)
Set cellFind = Range("A:A").FindNext(cellFind)
If Not cellFind Is Nothing Then i = cellFind.Row + 5
Set cellFind = Range("A:A").FindNext(cellFind)
If Not cellFind Is Nothing Then
Rows(cellFind.Row - 1).Insert
If Not i = Empty Then MiseEnFormeTableau Range(Cells(i, 1), Cells(cellFind.Row - 2, 4))
End If
End Sub
Sub MiseEnFormeTableau(tableau As Range)
With tableau.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With tableau.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With tableau.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With tableau.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With tableau.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlHairline
End With
With tableau.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlHairline
End With
End Sub