Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Excel 2003 VBA Help me complete this Search script

This is how I have it now. I tried to step into the Sub in the VBE,
but it won't let me, nothing is happening,
and the Sub don't show as a Marco that I can play, so I think I am
doing something wrong:


Sub FileFound(strFileName As String)

Dim path As Variant

Set fs = Application.FileSearch

With fs
.LookIn = "c:\Kevin\"
.SearchSubFolders = True
.Filename = strFileName & "*.txt"
.FileType = msoFileTypeAllFiles
If .Execute() 0 Then
MsgBox "There were " & .FoundFiles.Count & " file(s) found."
Else
MsgBox "There were no files found."
End If

ActiveSheet.Range("A1") =
Application.Transpose(ExtractNewFileName(strFileNa me))
Cells.EntireColumn.AutoFit

End With

End Sub




Function ExtractNewFileName(Filename As String) As String

Dim strFn As String

strFn = Mid(Filename, Len(Filename) - 11, 8) = 20071201 And
Mid(Filename, Len(Filename) - 11, 8) <= 20071212

ExtractNewFileName = strFn

End Function
Reply
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
Excel 2003 + script to open and automatically close an excel workb Neil Holden Excel Discussion (Misc queries) 1 March 4th 10 04:57 PM
Trying to convert a excel 2003 to 2007, but it contain script. Feejo Excel Discussion (Misc queries) 3 January 2nd 08 01:19 PM
Trying to convert a excel 2003 to 2007, but it contain script. Feejo New Users to Excel 2 December 31st 07 07:08 PM
Where can I find a free trial of excel and access 2003 complete? Millie Excel Discussion (Misc queries) 1 December 5th 07 03:50 PM
In search of VBA script ab500 Excel Programming 0 June 22nd 05 04:02 AM


All times are GMT +1. The time now is 03:50 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"