Amélioration/simplification de mon code
Résolu
bassmart
Messages postés
281
Date d'inscription
Statut
Membre
Dernière intervention
-
Utilisateur anonyme -
Utilisateur anonyme -
A voir également:
- Amélioration/simplification de mon code
- Code ascii - Guide
- Code de déverrouillage oublié - Guide
- Code puk bloqué - Guide
- Code activation windows 10 - Guide
- Code blocks - Télécharger - Langages
2 réponses
Bonsoir,
En mettant ce code dans un sub ou Fuction qui ne sert qu'à ça:
En mettant ce code dans un sub ou Fuction qui ne sert qu'à ça:
Sub Tito Sheets.Add.Move after:=Sheets(Sheets.Count) ActiveSheet.Name = "Graphique" Call zone_texte If ComboBox1 <= 3 Then Call graphique Exit Sub End if Sheets.Add.Move after:=Sheets(Sheets.Count) ActiveSheet.Name = "Graphique2" Call zone_texte If ComboBox1 <= 6 Then Call graphique Exit Sub End if Sheets.Add.Move after:=Sheets(Sheets.Count) ActiveSheet.Name = "Graphique3" Call zone_texte Call graphique End sub
Bonjour a vous deux,
ceci devrait aller
Private Sub ComboBox1_Change()
Mais vous n'avez pas droit a l'erreur, vous n'avez qu'un seul choix!!!!!!!!!
ceci devrait aller
Private Sub ComboBox1_Change()
If ComboBox1 <> "" Then Tito (ComboBox1.Value) End If End Sub
Sub Tito(Choix) Sheets.Add.Move after:=Sheets(Sheets.Count) ActiveSheet.Name = "Graphique" Call zone_texte If Choix <= 3 Then Call graphique Exit Sub End If Sheets.Add.Move after:=Sheets(Sheets.Count) ActiveSheet.Name = "Graphique2" Call zone_texte If Choix <= 6 Then Call graphique Exit Sub End If If Choix <= 9 Then Call graphique Sheets.Add.Move after:=Sheets(Sheets.Count) ActiveSheet.Name = "Graphique3" Call zone_texte Call graphique End If End Sub
Mais vous n'avez pas droit a l'erreur, vous n'avez qu'un seul choix!!!!!!!!!
Si ComboBox1 est inférieur ou égal à 3, il ajoute uniquement la feuille "graphique", si Combobox1 est inférieur ou égal à 6, il ajoute la feuille "graphique" et "graphique2" et si Combobox1 est inférieur ou égal à 9, il ajoute les trois feuilles.
merci!