Comment faire pour récupérer les onglets d'un classeur dans un combobox et
afficher la feuille correspobndant à l'onglet sélectionné?
--
Le partage du savoir contribue à l'amélioration de la condition humaine!
Merci à tous
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
isabelle
bonjour STEN83,
Sub Macro1() Dim f As Worksheet, x As Integer For Each f In Worksheets If f.Name = ActiveSheet.Name Then x = ComboBox1.ListCount ComboBox1.AddItem f.Name Next ComboBox1.ListIndex = x End Sub
Sub Macro1()
Dim f As Worksheet, x As Integer
For Each f In Worksheets
If f.Name = ActiveSheet.Name Then x = ComboBox1.ListCount
ComboBox1.AddItem f.Name
Next
ComboBox1.ListIndex = x
End Sub
Sub Macro1() Dim f As Worksheet, x As Integer For Each f In Worksheets If f.Name = ActiveSheet.Name Then x = ComboBox1.ListCount ComboBox1.AddItem f.Name Next ComboBox1.ListIndex = x End Sub
Comment faire pour récupérer les onglets d'un classeur dans un combobox et
afficher la feuille correspobndant à l'onglet sélectionné? -- Le partage du savoir contribue à l'amélioration de la condition humaine!
Merci à tous
STEN83
Désolé mais le code me renvoi une erreur "Objet requis" sur la ligne: If f.Name = ActiveSheet.Name Then x = ComboBox1.ListCount C'est peut être moi qui ne sais pas faire car la macro ou dois-je la mettre? Je l'ai placé dans le Worsheet Activate
bonjour STEN83,
Sub Macro1() Dim f As Worksheet, x As Integer For Each f In Worksheets If f.Name = ActiveSheet.Name Then x = ComboBox1.ListCount ComboBox1.AddItem f.Name Next ComboBox1.ListIndex = x End Sub
Désolé mais le code me renvoi une erreur "Objet requis" sur la ligne:
If f.Name = ActiveSheet.Name Then x = ComboBox1.ListCount
C'est peut être moi qui ne sais pas faire car la macro ou dois-je la mettre?
Je l'ai placé dans le Worsheet Activate
bonjour STEN83,
Sub Macro1()
Dim f As Worksheet, x As Integer
For Each f In Worksheets
If f.Name = ActiveSheet.Name Then x = ComboBox1.ListCount
ComboBox1.AddItem f.Name
Next
ComboBox1.ListIndex = x
End Sub
Désolé mais le code me renvoi une erreur "Objet requis" sur la ligne: If f.Name = ActiveSheet.Name Then x = ComboBox1.ListCount C'est peut être moi qui ne sais pas faire car la macro ou dois-je la mettre? Je l'ai placé dans le Worsheet Activate
bonjour STEN83,
Sub Macro1() Dim f As Worksheet, x As Integer For Each f In Worksheets If f.Name = ActiveSheet.Name Then x = ComboBox1.ListCount ComboBox1.AddItem f.Name Next ComboBox1.ListIndex = x End Sub
Sub Macro1() Dim f As Worksheet, x As Integer For Each f In Worksheets If f.Name = ActiveSheet.Name Then x = ComboBox1.ListCount ComboBox1.AddItem f.Name Next ComboBox1.ListIndex = x End Sub
Sub Macro1()
Dim f As Worksheet, x As Integer
For Each f In Worksheets
If f.Name = ActiveSheet.Name Then x = ComboBox1.ListCount
ComboBox1.AddItem f.Name
Next
ComboBox1.ListIndex = x
End Sub
Sub Macro1() Dim f As Worksheet, x As Integer For Each f In Worksheets If f.Name = ActiveSheet.Name Then x = ComboBox1.ListCount ComboBox1.AddItem f.Name Next ComboBox1.ListIndex = x End Sub
Sub Macro1() Dim f As Worksheet, x As Integer For Each f In Worksheets If f.Name = ActiveSheet.Name Then x = ComboBox1.ListCount ComboBox1.AddItem f.Name Next ComboBox1.ListIndex = x End Sub
Sub Macro1()
Dim f As Worksheet, x As Integer
For Each f In Worksheets
If f.Name = ActiveSheet.Name Then x = ComboBox1.ListCount
ComboBox1.AddItem f.Name
Next
ComboBox1.ListIndex = x
End Sub
Sub Macro1() Dim f As Worksheet, x As Integer For Each f In Worksheets If f.Name = ActiveSheet.Name Then x = ComboBox1.ListCount ComboBox1.AddItem f.Name Next ComboBox1.ListIndex = x End Sub