ptite_linda
XLDnaute Junior
Bonjour,
je suis débutante "au plus bas niveau".
Voilà ce que je veux faire : par exemple "si la valeur de ma cellule = 1 alors on la remplace par la valeur contenue dans une autre cellule sur une autre feuille."
voila comment j'ai écrit ça (i : la ligne / augm : nom de la feuille où je vais chercher mes valeurs.)
Public Sub pompes1()
'STOCK MAGASIN 1 MODIF DES COÛTS ET QUANTITÉS
Dim i As Long 'LIGNE
Sheets("POMPES1").Activate
For i = 14 To 509
'SI QUANTITÉ EST VIDE ALORS QUANTITÉ VIDE
If Cells(i, 3).Value = "" Then Cells(i, 3).Value = ""
'SI LA QUANTITÉ EST SUP OU = A 9 ON LA REMPLACE
If Cells(i, 3).Value <= 9 Then
If Cells(i, 3).Value = 1 Then Cells(i, 3).Value = Range("augm!G19")
If Cells(i, 3).Value = 2 Then Cells(i, 3).Value = Range("augm!G21")
If Cells(i, 3).Value = 3 Then Cells(i, 3).Value = Range("augm!G23")
If Cells(i, 3).Value = 4 Then Cells(i, 3).Value = Range("augm!G25")
If Cells(i, 3).Value = 5 Then Cells(i, 3).Value = Range("augm!G27")
If Cells(i, 3).Value = 6 Then Cells(i, 3).Value = Range("augm!G29")
If Cells(i, 3).Value = 7 Then Cells(i, 3).Value = Range("augm!G31")
If Cells(i, 3).Value = 8 Then Cells(i, 3).Value = Range("augm!G33")
If Cells(i, 3).Value = 9 Then Cells(i, 3).Value = Range("augm!G35")
If Cells(i, 3).Value = 0 Then Cells(i, 3).Value = Range("augm!G17")
le problème c'est qu'une fois que la 1ère condition est vérifiée ça passe à la condition d'en dessous alors que je veux sortir de la boucle et passer au i suivant
Quelle erreur je fais?
Quelle syntaxe dois-je utiliser?
je suis débutante "au plus bas niveau".
Voilà ce que je veux faire : par exemple "si la valeur de ma cellule = 1 alors on la remplace par la valeur contenue dans une autre cellule sur une autre feuille."
voila comment j'ai écrit ça (i : la ligne / augm : nom de la feuille où je vais chercher mes valeurs.)
Public Sub pompes1()
'STOCK MAGASIN 1 MODIF DES COÛTS ET QUANTITÉS
Dim i As Long 'LIGNE
Sheets("POMPES1").Activate
For i = 14 To 509
'SI QUANTITÉ EST VIDE ALORS QUANTITÉ VIDE
If Cells(i, 3).Value = "" Then Cells(i, 3).Value = ""
'SI LA QUANTITÉ EST SUP OU = A 9 ON LA REMPLACE
If Cells(i, 3).Value <= 9 Then
If Cells(i, 3).Value = 1 Then Cells(i, 3).Value = Range("augm!G19")
If Cells(i, 3).Value = 2 Then Cells(i, 3).Value = Range("augm!G21")
If Cells(i, 3).Value = 3 Then Cells(i, 3).Value = Range("augm!G23")
If Cells(i, 3).Value = 4 Then Cells(i, 3).Value = Range("augm!G25")
If Cells(i, 3).Value = 5 Then Cells(i, 3).Value = Range("augm!G27")
If Cells(i, 3).Value = 6 Then Cells(i, 3).Value = Range("augm!G29")
If Cells(i, 3).Value = 7 Then Cells(i, 3).Value = Range("augm!G31")
If Cells(i, 3).Value = 8 Then Cells(i, 3).Value = Range("augm!G33")
If Cells(i, 3).Value = 9 Then Cells(i, 3).Value = Range("augm!G35")
If Cells(i, 3).Value = 0 Then Cells(i, 3).Value = Range("augm!G17")
le problème c'est qu'une fois que la 1ère condition est vérifiée ça passe à la condition d'en dessous alors que je veux sortir de la boucle et passer au i suivant
Quelle erreur je fais?
Quelle syntaxe dois-je utiliser?