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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
Sub MettreUnFondDansUneCellule1(ByVal CC2 As ContentControl)
Dim oCell As Cell
Dim MaColonne As Integer
'Dim HeureDebut2, HeureFin2, TempsTotal2
Dim I As Long
' HeureDebut2 = Timer ' Définit l'heure de début.
MaColonne = 1
Application.ScreenUpdating = False
With ActiveDocument
For I = LBound(MatriceCC, 2) To UBound(MatriceCC, 2)
If MatriceCC(1, I) = CC2.Title Then
Debug.Print MatriceCC(0, I) & " : " & MatriceCC(1, I)
Set oCell = .Tables(1).Columns(MaColonne).Cells(MatriceCC(0, I))
With oCell
Select Case CC2.Range
Case "Zone A"
.Shading.BackgroundPatternColor = RGB(255, 255, 153)
CC2.Range.Shading.BackgroundPatternColor = RGB(255, 255, 153)
Case "Zone B"
.Shading.BackgroundPatternColor = wdColorRed
CC2.Range.Shading.BackgroundPatternColor = wdColorRed
Case "Zone C"
.Shading.BackgroundPatternColor = RGB(126, 177, 230)
CC2.Range.Shading.BackgroundPatternColor = RGB(126, 177, 230)
Case "Zone D"
.Shading.BackgroundPatternColor = RGB(146, 208, 80)
CC2.Range.Shading.BackgroundPatternColor = RGB(146, 208, 80)
Case Else
.Shading.BackgroundPatternColor = wdColorAutomatic
CC2.Range.Shading.BackgroundPatternColor = wdColorAutomatic
End Select
End With
Set oCell = Nothing
Exit For
End If
Next I
End With
Application.ScreenUpdating = True
' HeureFin2 = Timer ' Définit l'heure de fin.
' TempsTotal2 = HeureFin2 - HeureDebut2 ' Calcule la durée totale.
' Debug.Print "Temps total du traitement MettreUnFondDansUneCellule du " _
' & Date & " : " & Round(TempsTotal2, 0) & " seconde(s)"
End Sub |
Partager