Bonjour,
Comment contrôler si une variable toto est bien de type integer?
merci
Version imprimable
Bonjour,
Comment contrôler si une variable toto est bien de type integer?
merci
Un bout de code qui te dira si c'est un integer
Code:
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 Sub TestInteger() On Error GoTo Gerreur If IsNumeric(toto) = True Then 'Test si num inférieur a max integer On Error GoTo Gerreur toto = 32000 On Error GoTo Ginteger toto = 33000 GoTo Gerreur Ginteger: MsgBox "toto est un integer" End If Exit Sub Gerreur: MsgBox "toto n'est pas un integer" End Sub
merci :king: