bonjour,

voici un nouveau problème mais ça doit être plus facile

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Sub exercice2a()
    Dim col As Integer
    Dim lig As Integer
    Dim val As Integer
    'MsgBox ActiveCell.Address
    'MsgBox ActiveCell.Value
    col = ActiveCell.Column + 1
    lig = ActiveCell.Row
    Cells(lig, col).Activate
    val = ActiveCell.Value
    If (val%2=0) Then
        ActiveCell.Interior.Color = RGB(0, 0, 255)
        'ActiveCell.Text = "Paire"
    Else
        ActiveCell.Interior.Color = RGB(255, 0, 0)
        'ActiveCell.Text = "Impaire"
    End If
End Sub

Mon modulo ne fonctionne pas...


Merci