Dim Ap As New Application Private Sub Form_Load() Dim L L = Dir("C:\Mes documents\*.xls") List1.Clear List1.AddItem L While L <> "" L = Dir List1.AddItem L Wend List1.Text = List1.List(0) Ap.Visible = False End Sub Private Sub List1_Click() Ap.Visible = False Ap.Workbooks.Open (List1.Text) List2.Clear Dim W As Worksheet For Each W In Ap.Workbooks(List1.Text).Worksheets List2.AddItem W.Name Next W End Sub Private Sub Command1_Click() Dim i As Integer Ap.Workbooks.Open ("C:\Mes documents\" & List1.Text) For i = List2.ListCount - 1 To 1 Step -1 Ap.ActiveWorkbook.Worksheets(List2.List(i)).Move after:=Ap.ActiveWorkbook.Worksheets(i) Next i Ap.ActiveWorkbook.Worksheets(1).Select Ap.Visible = True Set Ap = Nothing Unload Me End End Sub
Je trouvais ça dommage que cette source ne soit pas cotée alors qu'elle certainement la plus complète sur les manip fichiers Excel.Complète, claire et simple --> 10/10
Se souvenir du profil
Mot de passe oublié ? / Activation de compteCréer un compte