Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This Code Worked EXCELLANT in 2003 - I'm having a time getting the equivalent
to work for me in 2007. Can someone assist me? TIA, Sub ListFiles() Dim s As String Dim sfolder As String sfolder = Range("D1").Value s = Range("B3").Value Range("B4:B65536").ClearContents s2 = "*" & s & "*.*" With Application.FileSearch .NewSearch .LookIn = sfolder .SearchSubFolders = True .Filename = s2 .FileType = msoFileTypeAllFiles If .Execute() 0 Then MsgBox "There were " & .FoundFiles.Count & _ " file(s) found." For i = 1 To .FoundFiles.Count ActiveSheet.Cells(i + 3, 2).Value = _ Mid(.FoundFiles(i), 64, 256) Next i Else MsgBox "There were no files found." End If End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
What's the vba code equivalent for Countif | Excel Discussion (Misc queries) | |||
Code equivalent to Alt + Tab | Excel Programming | |||
CODE Function equivalent in VBA | Excel Programming | |||
Does XML have equivalent code for ADO? | Excel Programming | |||
Indirect equivalent in VBA code | Excel Programming |