Je veux que vous me lisiez le code suivant
Donc, pour l'apprendre et faire un programme comme celui-ci
Je veux que quelqu'un m'apprenne ce code
Merci
le code....
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
On Error Resume Next
Dim Nbr As Single
If ActiveCell.Row < 9 Then Exit Sub
If Cells(100, 1).Value = 1959 Then
If Target.Column = 4 And Val(Target.Text) > 20 Then
MsgBox ("superieure a 20")
Target.Value = 0
End If
If Cells(100, 1).Value = 1959 And Target.Column <> 4 Then Exit Sub
Target.Value = Val(Target.Value)
Else
Select Case Target.Column
Case 4 To 6
'MsgBox (Val(Target.Cells(Target.Row, Target.Column)))
If Val(Target.Text) > 20 Then
MsgBox ("superieure a 20")
Target.Value = 1
End If
Target.Value = Val(Target.Value)
Case 7
If Val(Cells(4, 9).Value) = 0 Then Nbr = 60 Else Nbr = Val(Val(Cells(4, 9).Value))
If Val(Target.Text) > Nbr Then
MsgBox ("superieure " & Cells(4, 9).Value)
Target.Value = 0
End If
Target.Value = Val(Target.Value)
End Select
End If
End Sub
Donc, pour l'apprendre et faire un programme comme celui-ci
Je veux que quelqu'un m'apprenne ce code
Merci
le code....
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
On Error Resume Next
Dim Nbr As Single
If ActiveCell.Row < 9 Then Exit Sub
If Cells(100, 1).Value = 1959 Then
If Target.Column = 4 And Val(Target.Text) > 20 Then
MsgBox ("superieure a 20")
Target.Value = 0
End If
If Cells(100, 1).Value = 1959 And Target.Column <> 4 Then Exit Sub
Target.Value = Val(Target.Value)
Else
Select Case Target.Column
Case 4 To 6
'MsgBox (Val(Target.Cells(Target.Row, Target.Column)))
If Val(Target.Text) > 20 Then
MsgBox ("superieure a 20")
Target.Value = 1
End If
Target.Value = Val(Target.Value)
Case 7
If Val(Cells(4, 9).Value) = 0 Then Nbr = 60 Else Nbr = Val(Val(Cells(4, 9).Value))
If Val(Target.Text) > Nbr Then
MsgBox ("superieure " & Cells(4, 9).Value)
Target.Value = 0
End If
Target.Value = Val(Target.Value)
End Select
End If
End Sub