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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
| Private Sub Worksheet_change(ByVal Target As Range)
On Error Resume Next
If Target.Value = "aaaaaaa" Then
Target.Font.ColorIndex = 0
End If
My_chantier_pos = InStr(1, Cells(RowIndex, 7), "-")
My_chantier = Mid(Cells(RowIndex, 7), My_chantier_pos + 1, 4)
If My_chantier = "bbbbb" Then
Cells(RowIndex, 4) = "cccccc"
End If
Resume
End Sub
Private Sub Worksheet_calculate()
Application.ScreenUpdating = False '''Pour désactiver la mise à jour de l'affichage
Dim My_cell_AM
Dim My_lines
Dim My_chantier_pos
Dim My_chantier
My_lines = Cells(4, 74)
On Error Resume Next
For RowIndex = 4 To My_lines
My_cell_AM = Cells(RowIndex, 13)
If My_cell_AM = "" Then
Cells(RowIndex, 21) = ""
Else
If My_cell_AM = "zzzzz" Then
If Len(Cells(RowIndex, 21)) < 2 Then
Cells(RowIndex, 21) = "yyyyy"
End If
Else
If My_cell_AM = "xxxxx" Then
If Len(Cells(RowIndex, 21)) < 2 Then
Cells(RowIndex, 21) = "ggggg"
End If
Else
If Len(Cells(RowIndex, 21)) < 2 Then
Cells(RowIndex, 21) = "---"
End If
End If
End If
End If
My_chantier_pos = InStr(1, Cells(RowIndex, 7), "-")
My_chantier = Mid(Cells(RowIndex, 7), My_chantier_pos + 1, 4)
If My_chantier = "aaaaa" Then
Cells(RowIndex, 4) = "zzzzz"
End If
If My_chantier = "bbbbb" Then
Cells(RowIndex, 4) = "yyyyy"
End If
If My_chantier = "ccccc" Then
Cells(RowIndex, 4) = "xxxxx"
End If
If My_chantier = "ddddd" Then
Cells(RowIndex, 4) = "wwwww"
End If
If My_chantier = "eeeee" Then
Cells(RowIndex, 4) = "vvvvv"
End If
If My_chantier = "fffff" Then
Cells(RowIndex, 4) = "uuuuu"
End If
Next
End Sub |
Partager