1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| For Each objShp In objSld.Shapes
If objShp.HasTable Then
With objShp.Table
.Cell(1, 1).Shape.TextFrame.TextRange.Text = Tablo(i, 2) 'Tableau
.Cell(4, 1).Shape.TextFrame.TextRange.Text = Tablo(i, 6) 'Qte
.Cell(4, 2).Shape.TextFrame.TextRange.Text = Tablo(i, 7) 'Description1
.Cell(5, 2).Shape.TextFrame.TextRange.Text = Tablo(i, 11) 'Description2
.Cell(5, 2).Shape.TextFrame.TextRange.Text = Tablo(i, 12) 'Description2
'=============================================================================
'nouvelle condition :
'si la cellule B = G, alors
x = 0
Do
'copie la ligne 4 et 5 du tableau du slide et ajoute les à la suite
If x > 0 Then
.Rows.Add
.Rows.Add End If
'et remplit les avec les données
.Cell(4 + (2 * x), 1).Shape.TextFrame.TextRange.Text = Tablo(i, 6) 'Qte
.Cell(4 + (2 * x), 2).Shape.TextFrame.TextRange.Text = Tablo(i, 7) 'Description1
.Cell(5 + (2 * x), 2).Shape.TextFrame.TextRange.Text = Tablo(i, 11) 'Description2
.Cell(5 + (2 * x), 3).Shape.TextFrame.TextRange.Text = Tablo(i, 12) 'Description2
'et autant de fois qu'il y a de lignes où cell B = G
i = i + 1
x = x + 1
If i > UBound(Tablo) Then Exit Do
Loop While Tablo(i, 2) = Tablo(i - 1, 2)
End With
End If
Next
Next |
Partager