Hi all
this code dumps a list of .dat file names into a list box.
it is a multiselect list box with check boxes.

what i am trying to do is when i check multiple items in the list it will import the text file/s into the current workbook,leaving me with a sheet for each imported text file

any ideas would be helpful.
cheers

[vba]Public Sub CommandButton11_Click()
With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\Dan\My Documents\Copy of Sapflow"
.SearchSubFolders = True
.Filename = "*.dat"
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
WSUD.ListBox1.AddItem Dir(.FoundFiles(i), vbDirectory)
Next i
Else
MsgBox "There were no files found."
End If
End With
end sub[/vba]