Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to find all files in some directories and all thtis files start with
the same string. Regards Lopar |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What do you want to do with the files once found? Open them, list their
names on a sheet, .... Regards Rowan Ivica Lopar wrote: I need to find all files in some directories and all thtis files start with the same string. Regards Lopar |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I wont to put string in textbox1 and then clik commandbutton and have all path of files in listbox1 lop *** Sent via Developersdex http://www.developersdex.com *** |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm guessing here but if you want to enter the path in TextBox1 and have
all excel files in that folder listed in listbox1 then you would do it like this: Private Sub CommandButton1_Click() Dim objFSO As Object Dim objFolder As Object Dim objFile As Object Set objFSO = CreateObject("Scripting.FileSystemObject") On Error Resume Next Set objFolder = objFSO.GetFolder(Me.TextBox1.Text) On Error GoTo 0 If Not objFolder Is Nothing Then For Each objFile In objFolder.Files If objFile.Type = "Microsoft Excel Worksheet" Then Me.ListBox1.AddItem objFile.Name End If Next End If End Sub Hope this helps Rowan ivica lopar wrote: I wont to put string in textbox1 and then clik commandbutton and have all path of files in listbox1 lop *** Sent via Developersdex http://www.developersdex.com *** |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is what I wont but this files are pictures not excel files
Regards lop *** Sent via Developersdex http://www.developersdex.com *** |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub CommandButton7_Click()
Dim objFSO As Object Dim objFolder As Object Dim objFile As Object Set objFSO = CreateObject("Scripting.FileSystemObject") On Error Resume Next Set objFolder = objFSO.GetFolder(Me.TextBox4.Text) On Error GoTo 0 If Not objFolder Is Nothing Then For Each objFile In objFolder.Files If objFile.Type = "JPEG Image" Then Me.list1.AddItem objFile.Name End If Next End If This is what I tryed but it did not work out lop *** Sent via Developersdex http://www.developersdex.com *** |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I heve folder named "Pictures" in that folder I have pictures that there
names start with some string for example "1201052" now when i put this string in TextBox1 I wont all path of pictures that start with that string to put in listBox1 Regards lop *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Where is "open/tools/find/find files that match these criteria"? | Excel Discussion (Misc queries) | |||
Find Files | Excel Programming | |||
backwards find function to find character in a string of text | Excel Programming | |||
FileSearch doesn't find zip files | Excel Programming | |||
Import multiple files macro can't find files | Excel Programming |