Everlast03
XLDnaute Occasionnel
Bonjour,
Je pense que tout est dans le titre mais je vais quand même approfondir mon explication.
Je créé une macro qui, d'après un test lance un userform (ou apparait des données à consulter). Une fois que j'ai pris note de celles-ci je peux donc fermer l'userform (grâce à un bouton simple). Puis ensuite, je veux continuer à exécuter ma macro.
Mon fichier est énorme donc je poste ma macro :
Merci d'avance
Je pense que tout est dans le titre mais je vais quand même approfondir mon explication.
Je créé une macro qui, d'après un test lance un userform (ou apparait des données à consulter). Une fois que j'ai pris note de celles-ci je peux donc fermer l'userform (grâce à un bouton simple). Puis ensuite, je veux continuer à exécuter ma macro.
Mon fichier est énorme donc je poste ma macro :
Code:
Sub Macro()
fin = Range("a65535").End(xlUp).Row
cat1 = "Catégorie 1 (de 4 à 15J). Coûts moyens : 499€"
cat2= "Catégorie 2 (de 16 à 30J). Coûts moyens : 599€"
cat3 = "Catégorie 3 (de 31 à 51J). Coûts moyens : 699€"
cat4 = "Catégorie 4 (de 52 à 72J). Coûts moyens : 799€"
For i = 14 To fin
Cells(i, 23).Value = Cells(1, 1).Value - Cells(i, 3).Value
If Cells(i, 23).Value > 9 And Cells(i, 23).Value < 16 Then
UserForm1.Label1.Caption = Cells(i, 6).Value
UserForm1.Label4.Caption = Cells(i, 23).Value
UserForm1.Label6.Caption = cat1
UserForm1.Label3.Caption = "Nombre de jours perdus au " & Cells(1, 1).Value & ":"
UserForm1.Show
End If
If Cells(i, 23).Value > 39 And Cells(i, 23).Value < 46 Then
UserForm1.Label1.Caption = Cells(i, 6).Value
UserForm1.Label4.Caption = Cells(i, 23).Value
UserForm1.Label6.Caption = cat1
UserForm1.Label3.Caption = "Nombre de jours perdus au " & Cells(1, 1).Value & ":"
UserForm1.Show
End If
If Cells(i, 23).Value > 84 And Cells(i, 23).Value < 91 Then
UserForm1.Label1.Caption = Cells(i, 6).Value
UserForm1.Label4.Caption = Cells(i, 23).Value
UserForm1.Label6.Caption = cat1
UserForm1.Label3.Caption = "Nombre de jours perdus au " & Cells(1, 1).Value & ":"
UserForm1.Show
End If
If Cells(i, 23).Value > 144 And Cells(i, 23).Value < 151 Then
UserForm1.Label1.Caption = Cells(i, 6).Value
UserForm1.Label4.Caption = Cells(i, 23).Value
UserForm1.Label6.Caption = cat1
UserForm1.Label3.Caption = "Nombre de jours perdus au " & Cells(1, 1).Value & ":"
UserForm1.Show
End If
'C est ici que je voudrais reprendre pour continuer mon test
Next
End Sub
Merci d'avance