Probleme boucle excel
Fermé
Steefif
Messages postés
485
Date d'inscription
lundi 7 juillet 2008
Statut
Membre
Dernière intervention
15 février 2013
-
18 juil. 2008 à 10:23
Steefif Messages postés 485 Date d'inscription lundi 7 juillet 2008 Statut Membre Dernière intervention 15 février 2013 - 18 juil. 2008 à 10:43
Steefif Messages postés 485 Date d'inscription lundi 7 juillet 2008 Statut Membre Dernière intervention 15 février 2013 - 18 juil. 2008 à 10:43
A voir également:
- Probleme boucle excel
- Liste déroulante excel - Guide
- Formule excel - Guide
- Si et excel - Guide
- Aller à la ligne excel - Guide
- Mise en forme conditionnelle excel - Guide
3 réponses
zavenger
Messages postés
811
Date d'inscription
vendredi 29 février 2008
Statut
Membre
Dernière intervention
20 avril 2012
161
18 juil. 2008 à 10:41
18 juil. 2008 à 10:41
Bonjour
Cela devrait le faire
For j = 82 To 200 Step 0.1
LoopOK = False
For k = 80 To 200 Step 0.1
If LoopOK = True
Exit For
End If
For n = 1 To k Step 0.1
If LoopOK = True
Exit For
End If
For x = 0.1 To 200 Step 0.1
If LoopOK = True
Exit For
End If
a = Sqr(74529 - 546 * n + n * n + x * x) 'x vanriable
If a < 200 Then
test = x * x + n * n - k * k + 546 * (k - n)
z = Sqr(test)
b = Sqr(n * n + x * x)
c = Sqr(k * k + z * z)
Cells(49, col).Select
Cells(49, col).Value = a
If Fix(a) < (a + 0.001) And Fix(a) > (a - 0.001) And Fix(b) < (b + 0.001) And Fix(b) > (b - 0.001) And Fix(c) < (c + 0.001) And Fix(c) > (c - 0.001) Then
Sheets("feuil5").Activate
Cells(50, col).Value = a
Cells(51, col).Value = b
Cells(52, col).Value = c
Cells(53, col).Value = j
Cells(54, col).Value = k
Cells(55, col).Value = n
Cells(56, col).Value = x
col = col + 1
LoopOK = True
End If
End If
Next x
Next n
Next k
Next j
Cells(50, 1).Select
Cela devrait le faire
For j = 82 To 200 Step 0.1
LoopOK = False
For k = 80 To 200 Step 0.1
If LoopOK = True
Exit For
End If
For n = 1 To k Step 0.1
If LoopOK = True
Exit For
End If
For x = 0.1 To 200 Step 0.1
If LoopOK = True
Exit For
End If
a = Sqr(74529 - 546 * n + n * n + x * x) 'x vanriable
If a < 200 Then
test = x * x + n * n - k * k + 546 * (k - n)
z = Sqr(test)
b = Sqr(n * n + x * x)
c = Sqr(k * k + z * z)
Cells(49, col).Select
Cells(49, col).Value = a
If Fix(a) < (a + 0.001) And Fix(a) > (a - 0.001) And Fix(b) < (b + 0.001) And Fix(b) > (b - 0.001) And Fix(c) < (c + 0.001) And Fix(c) > (c - 0.001) Then
Sheets("feuil5").Activate
Cells(50, col).Value = a
Cells(51, col).Value = b
Cells(52, col).Value = c
Cells(53, col).Value = j
Cells(54, col).Value = k
Cells(55, col).Value = n
Cells(56, col).Value = x
col = col + 1
LoopOK = True
End If
End If
Next x
Next n
Next k
Next j
Cells(50, 1).Select
shishumi
Messages postés
18
Date d'inscription
vendredi 16 mai 2008
Statut
Membre
Dernière intervention
1 décembre 2008
18 juil. 2008 à 10:31
18 juil. 2008 à 10:31
Bonjour,
essaye un
essaye un
END next k
Steefif
Messages postés
485
Date d'inscription
lundi 7 juillet 2008
Statut
Membre
Dernière intervention
15 février 2013
19
18 juil. 2008 à 10:43
18 juil. 2008 à 10:43
merci bcp, je file voir si ca marche!