Bonjour à vous voila mon probléme est que je voudrais inserer le résultat d'une combobox pour completer mon chemin de recherche qui utlise la fonction .lookin et sa plante merci de votre aide.
jm
voici le code
Private Sub CommandButton1_Click()
Dim i As Integer
Dim j As Variant
j = ComboBox1.Value
With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\jeanmimi\Bureau\MBR\Suivi-BT-HV\" & "j"
.SearchSubFolders = True
.Filename = "*" 'pour une cellule Range("b3")
If UserForm1.ComboBox1.Text = "" Then
MsgBox "Vous n'avez pas saiside model;" & Chr(10) & "Recommencez! "
Exit Sub
End If
ComboBox1.Text = ""
End With
With Application.FileSearch
If .Execute() > 0 Then
MsgBox .FoundFiles.Count & " Fichier(s) trouvé(s) "
Range("A6").Select
For i = 1 To .FoundFiles.Count
ActiveCell.Value = .FoundFiles(i)
ActiveCell.Offset(1, 0).Range("A1").Select
Next i
Else
MsgBox "Aucun fichier correspondant à ce critère"
End If
Unload UserForm1
UserForm2.Show
' Loop through the array and fill the list box on the UserForm.
'For i = 1 To fs.FoundFiles.Count
UserForm2.ListBox1.AddItem (i)
'Next i
End With
End Sub
jm
voici le code
Private Sub CommandButton1_Click()
Dim i As Integer
Dim j As Variant
j = ComboBox1.Value
With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\jeanmimi\Bureau\MBR\Suivi-BT-HV\" & "j"
.SearchSubFolders = True
.Filename = "*" 'pour une cellule Range("b3")
If UserForm1.ComboBox1.Text = "" Then
MsgBox "Vous n'avez pas saiside model;" & Chr(10) & "Recommencez! "
Exit Sub
End If
ComboBox1.Text = ""
End With
With Application.FileSearch
If .Execute() > 0 Then
MsgBox .FoundFiles.Count & " Fichier(s) trouvé(s) "
Range("A6").Select
For i = 1 To .FoundFiles.Count
ActiveCell.Value = .FoundFiles(i)
ActiveCell.Offset(1, 0).Range("A1").Select
Next i
Else
MsgBox "Aucun fichier correspondant à ce critère"
End If
Unload UserForm1
UserForm2.Show
' Loop through the array and fill the list box on the UserForm.
'For i = 1 To fs.FoundFiles.Count
UserForm2.ListBox1.AddItem (i)
'Next i
End With
End Sub