Et logique avec masque

Bonjours voila mon probleme je doit faire un programme pour le travaille et quand je fait ce code j'au une erreur 6 depassement de capacité.

le code fonctionne jusqu’à 2^30 mais après sa veut plus quelqu'un pour me donner un coup de main car sa fait 2 semaine que je cherche et je trouve pas je sais plus ou comment chercher

ag = 2147483648
 if 2147483648 and ag then
v32="1"
else
v32="0"
end if

ici je souhaiterai avoir un résultat v32="1" mais j'ai v32="0"

par la suite je souhaiterai faire sa

a = 1
b = 2
c = 4
d = 8
e = 16
f = 32
g = 64
h = 128
ia = 256
ja = 512
k = 1024
l = 2048
m = 4096
n = 8192
o = 16384
p = 32768
q = 65536
r = 131072
t = 262144
u = 524288
v = 1048576
w = 2097152
x = 4194304
y = 8388608
Z = 16777216
aa = 33554432
ab = 67108864
ac = 134217728
ad = 268435456
ae = 536870912
af = 1073741824
ag = 2147483648#

variable = T11.Value  ' textbox dans mon userform
If variable And a Then
v1 = "1"
Else
v1 = "0"
End If
If variable And b Then
v2 = "1"
Else
v2 = "0"
End If
If variable And c Then
v3 = "1"
Else
v3 = "0"
End If
If variable And d Then
v4 = "1"
Else
v4 = "0"
End If
If variable And e Then
v5 = "1"
Else
v5 = "0"
End If
If variable And f Then
v6 = "1"
Else
v6 = "0"
End If
If variablee And g Then
v7 = "1"
Else
v7 = "0"
End If
If variable And h Then
v8 = "1"
Else
v8 = "0"
End If
If variable And ia Then
v9 = "1"
Else
v9 = "0"
End If
If variable And ja Then
v10 = "1"
Else
v10 = "0"
End If
If variable And k Then
v11 = "1"
Else
v11 = "0"
End If
If variable And l Then
v12 = "1"
Else
v12 = "0"
End If
If variable And m Then
v13 = "1"
Else
v13 = "0"
End If
If variable And n Then
v14 = "1"
Else
v14 = "0"
End If
If variable And o Then
v15 = "1"
Else
v15 = "0"
End If
If variable And p Then
v16 = "1"
Else
v16 = "0"
End If
If variable And q Then
v17 = "1"
Else
v17 = "0"
End If
If variable And r Then
v18 = "1"
Else
v18 = "0"
End If
If variable And s Then
v19 = "1"
Else
v19 = "0"
End If
If variable And t Then
v20 = "1"
Else
v20 = "0"
End If
If variable And u Then
v21 = "1"
Else
v21 = "0"
End If
If variable And v Then
v22 = "1"
Else
v22 = "0"
End If
If T11.Value And w Then
v23 = "1"
Else
v23 = "0"
End If
If variable And x Then
v24 = "1"
Else
v24 = "0"
End If
If variable And y Then
v25 = "1"
Else
v25 = "0"
End If
If variable And Z Then
v26 = "1"
Else
v26 = "0"
End If
If variable And aa Then
v27 = "1"
Else
v27 = "0"
End If
If variable And ab Then
v28 = "1"
Else
v28 = "0"
End If
If variable And ac Then
v29 = "1"
Else
v29 = "0"
End If
If variable And ad Then
v30 = "1"
Else
v30 = "0"
End If
If variable And ae Then
v31 = "1"
Else
v31 = "0"
End If
If variable And ag Then
v32 = "1"
Else
v32 = "0"
End If

merci d'avance de votre aide

Bonjour,

Je ne comprends pas ton test, essaye comme ça :

Si ag est déclarée comme nombre :

If ag = variable * 1 Then

Si ag est déclarée comme une chaine texte :

If ag = variable Then

NB : pour comparer il faut deux valeurs soient de même type.

sa compare au niveau binaire

merci pour votre aide mais quelqu'un ma aidé sur un autre forum

103test-1.zip (77.64 Ko)
Rechercher des sujets similaires à "logique masque"