bonjour je commence a apprendre le VBA et il y a certaine chose qui m'échappe encore je ne comprend pas pourquoi le ne veux pas faire les + et / et je cherche la ou j'aurais pus faire des fautes mais je ne trouve pas merci de m'aider
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
19
20
21
22
23
24
25
26
27
28
29
30
31
32 Public Sub masub() Cal1 = InputBox("donnez moi 1 nombre") op = InputBox("donnez un operateur") Cal2 = InputBox("Donnez moi 1 2eme nombre") If op = "*" Then produit = Cal1 * Cal2 MsgBox ("le resultat est = " & produit) End If If op = "+" Then somme = Cal1 + Cal2 MsgBox ("le resultat est = " & somme) End If If op = "-" Then reste = Cal1 - Cal2 MsgBox ("le resultat est = " & reste) End If If op = "/" Then If Cal2 = 0 Then ErrorC = MsgBox("Calcul error Div 0", vbCritical) End If If Cal2 <> 0 Then Quo = (cla1 / Cal2) MsgBox ("le resultat est = " & Quo) End If End If End Sub
Partager