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 57 58 59 60 61 62 63 64 65 66 67 68
| 'si la longueur de la provinciale courte est plus grand que 100, le texte est en rouge sur fond bleu
If Len(Cells(x + 1, [prov_court_travail].Column)) > 100 Then
compteur = compteur + 1
If Cells(x + 1, [prov_court_travail].Column).Font.ColorIndex <> 3 And _
Cells(x + 1, [prov_court_travail].Column).Interior.ColorIndex <> 34 Then
Cells(x + 1, [prov_court_travail].Column).Copy
Cells(x + 1, [couleur_prov_court_travail].Column).PasteSpecial (xlPasteFormats)
With Cells(x + 1, [prov_court_travail].Column)
.Font.ColorIndex = 3
.Interior.ColorIndex = 34
End With
End If
Else
If Cells(x + 1, [prov_court_travail].Column).Font.ColorIndex <> 3 And _
Cells(x + 1, [prov_court_travail].Column).Interior.ColorIndex <> 34 Then
Cells(x + 1, [prov_court_travail].Column).Copy
Cells(x + 1, [couleur_prov_court_travail].Column).PasteSpecial (xlPasteFormats)
End If
End If
'si la provinciale courte est vide on inscrit ??? et on met en rouge sur fond bleu
If IsEmpty(Cells(x + 1, [prov_court_travail].Column)) Then
compteur = compteur + 1
With Cells(x + 1, [prov_court_travail].Column)
.value = "???"
.Font.ColorIndex = 3
.Interior.ColorIndex = 34
End With
Else
If Cells(x + 1, [prov_court_travail].Column).Font.ColorIndex <> 3 And _
Cells(x + 1, [prov_court_travail].Column).Interior.ColorIndex <> 34 Then
Cells(x + 1, [prov_court_travail].Column).Copy
Cells(x + 1, [couleur_prov_court_travail].Column).PasteSpecial (xlPasteFormats)
End If
End If
'si on a toujours une descripton provinciale courte = ??? ou plus grande que 100 caractères on maintien la couleur rouge sur fond bleu
If Cells(x + 1, [prov_court_travail].Column) = "???" Or Len(Cells(x + 1, [prov_court_travail].Column)) > 100 Then
compteur = compteur + 1
With Cells(x + 1, [prov_court_travail].Column)
.Font.ColorIndex = 3
.Interior.ColorIndex = 34
End With
Else
Cells(x + 1, [couleur_prov_court_travail].Column).Copy
Cells(x + 1, [prov_court_travail].Column).PasteSpecial (xlPasteFormats)
End If |
Partager