L
ludosoazic
Guest
Bonjour à tous ,
Je suis novice en vba et j'ai un problème ,surement pas grand chose,avec le code suivant.Le probleme est que la boucle ne s'arrete pas.
Merci d'avance pour votre aide.
Private Sub CommandButtonValider_Click()
For i = 4 To 34
For j = 1 To 72
If Sheets("" & Me.ComboBoxMois.Value).Cells(2, j).Value = Me.ComboBoxVehicule.Value Then
If Sheets("" & Me.ComboBoxMois.Value).Cells(i, j).Value = "" Then
Sheets("" & Me.ComboBoxMois.Value).Cells(i, j - 1).Value = Me.TextBoxQuantite.Value
Sheets("" & Me.ComboBoxMois.Value).Cells(i, j).Value = Me.TextBoxKilometrage.Value
Sheets("" & Me.ComboBoxMois.Value).Cells(i, j + 1).Value = Me.TextBoxNom.Value
Exit For
End If
End If
Next
Next
Je suis novice en vba et j'ai un problème ,surement pas grand chose,avec le code suivant.Le probleme est que la boucle ne s'arrete pas.
Merci d'avance pour votre aide.
Private Sub CommandButtonValider_Click()
For i = 4 To 34
For j = 1 To 72
If Sheets("" & Me.ComboBoxMois.Value).Cells(2, j).Value = Me.ComboBoxVehicule.Value Then
If Sheets("" & Me.ComboBoxMois.Value).Cells(i, j).Value = "" Then
Sheets("" & Me.ComboBoxMois.Value).Cells(i, j - 1).Value = Me.TextBoxQuantite.Value
Sheets("" & Me.ComboBoxMois.Value).Cells(i, j).Value = Me.TextBoxKilometrage.Value
Sheets("" & Me.ComboBoxMois.Value).Cells(i, j + 1).Value = Me.TextBoxNom.Value
Exit For
End If
End If
Next
Next