LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 477
Default Need equivalent code for 2007

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's the vba code equivalent for Countif NDBC Excel Discussion (Misc queries) 3 July 4th 09 11:42 AM
Code equivalent to Alt + Tab Jimbob Excel Programming 9 July 10th 07 12:26 PM
CODE Function equivalent in VBA Edmund Excel Programming 3 September 13th 06 03:14 AM
Does XML have equivalent code for ADO? XP Excel Programming 1 February 22nd 06 05:22 PM
Indirect equivalent in VBA code Ken Rock Excel Programming 2 September 24th 05 02:25 PM


All times are GMT +1. The time now is 10:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"