Bonjour,

Etant novice dans le domaine je me permet de me joindre à vous pour un service.
Actuellement via une macro, je peut lister tous les fichiers et sous-répertoires présent dans le répertoire ou se trouve le fichier excel.
Cependant, je souhaiterai Via une MsgBox pouvoir choisir le répertoire.

En vous remerciant d'avance.

Cordialement

--------------------------------------------------------------------------------------------------
Ci-dessous la macrro:
--------------------------------------------------------------------------------------------------
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Sub Arborescence() 
 Application.ScreenUpdating = False 
 Racine = CurDir 
 If Racine = "" Then Exit Sub 
 Range("A:E").Clear 
 Range("A3").Select 
 Set fs = CreateObject("Scripting.FileSystemObject") 
 Set dossier_racine = fs.getfolder(Racine) 
 Lit_dossier dossier_racine, 1 
 Range("A1").Select 
End Sub 
Sub Lit_dossier(ByRef dossier, ByVal niveau) 
 With ActiveCell.Font 
 .Size = 11 
 .Underline = True 
 .Bold = True 
 ActiveCell.Value = decal(niveau - 1) & "--------> " & dossier.Name & " <-------- " 
ActiveCell.Interior.ColorIndex = 33 
 ActiveCell.Offset(1, 0).Select 
 For Each d In dossier.SubFolders 
 Lit_dossier d, niveau + 1 
 Next 
 For Each f In dossier.Files 
 nom_fich = f.Name 
 ActiveSheet.Hyperlinks.Add Anchor:=Selection, _ 
 Address:=dossier.Path & "\" & nom_fich, TextToDisplay:="" & nom_fich 
 ActiveCell.Offset(0, 1) = f.Size 
 ActiveCell.Offset(0, 2) = f.DateLastModified 
 ActiveCell.Offset(0, 3) = f.Attributes 
 If f.Attributes And vbHidden Then ActiveCell.Offset(0, 4) = "Caché" 
 ActiveCell.Interior.ColorIndex = 2 
 ActiveCell.Offset(1, 0).Select 
 Next 
End With 
End Sub 
Function decal(niv) 
 decal = String(3 * niv, " ") 
End Function 
Function ChoixDossier() 
 If Val(Application.Version) >= 10 Then 
 With Application.FileDialog(msoFileDialogFolderPicker) 
 .InitialFileName = ActiveWorkbook.Path & "\" 
 .Show 
 If .SelectedItems.Count > 0 Then 
 ChoixDossier = .SelectedItems(1) 
 Else 
 ChoixDossier = "" 
 End If 
 End With 
 Else 
 ChoixDossier = InputBox("Répertoire?") 
 End If 
End Function