Private Sub UserForm_Initialize()
For i = 1 To 4 ' => pour lister les 4 pays
ComboBox_Pays.AddItem Cells(1, i)
Next
TousLesDossiers "C:\Users\Thomas\Desktop\", 2
End Sub
Sub TousLesDossiers(ByVal LeDossier$, ByVal Niv&)
Dim fso As Object, Dossier As Object
Dim sousRep As Object, Flder As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set Dossier = fso.GetFolder(LeDossier)
'examen du dossier courant
For Each Flder In Dossier.subfolders
On Error Resume Next
Me.ListBox_Villes.AddItem Flder.Path
Next Flder
'traitement récursif des sous dossiers
Niv = Niv - 1: If Niv <= 0 Then Exit Sub
For Each sousRep In Dossier.subfolders
TousLesDossiers sousRep.Path, Niv
Next sousRep
End Sub