Bonjours,
J'ai créé un "ListBox" a partie des feuiiles présentes dans un classeur (la quantité et les noms peuvent varier)......Ça fonctionne
Par la suite j'ai créé un bouton de commande pour sélectionner certaines feuilles (avec la sélection multiple).....Ça fonctionne
Maintenant, comment pourrais-je faire pour imprimer ma sélection ?
Merci à l'avance
MG
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 Option Explicit Option Base 1 Private Sub UserForm_Initialize() Dim MyUniqueList As Variant, i As Long, ws As Variant, EntryCount As Single With UserForm2.ListBox1 .Clear ' clear the listbox content For Each ws In Worksheets EntryCount = EntryCount + 1 ListBox1.AddItem Sheets(EntryCount).Name Next ws .ListIndex = 0 ' select the first item End With End Sub Private Sub CommandButton1_Click() 'Finds selected items in ListBox1 in userform UserForm2 Dim Msg As String, i As Integer Msg = "" With UserForm2.ListBox1 For i = 0 To .ListCount - 1 If .Selected(i) Then Msg = Msg & .List(i) & Chr(13) End If Next i End With MsgBox Msg, , "Les feuilles à imprimer sont...." Unload Me End Sub
Partager