LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Date search and date extract

That's correct Jay, it doesn't seem to work with csv files, but it does with
txt files.

BTW FYI FileSearch has gone in Excel 2007.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Jay" wrote in message
...
Hi Joe and Bob -

Bob, I couldn't get Windows Search to find the "phrase" 36075 when I
captured Joe's data in a .csv file on my hard drive. Any ideas why it
wouldn't work ? It sounds like a great way to solve Joe's problem.

In the meantime, Joe, here's an all VBA solution. The code below should
be
copied to the worksheet module of a blank worksheet. Change the
'myFolderPath' statement as needed. The code executes whenever you enter
a
job number in Cell A1 and it outputs the list starting in Cell A2:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
If Target.Value < "" Then
Application.EnableEvents = False
Range(Cells(2, 1), Cells(Rows.Count, 1)).Clear
Range("B1") = "Searching. Please Wait..."
Target.Select
jobNumber = Target.Value
myFolderPath = "My Documents" '<---Change to suit

With Application.FileSearch
.LookIn = myFolderPath
.SearchSubFolders = True 'or False
.FileType = msoFileTypeAllFiles
.TextOrProperty = jobNumber
.Execute
For Each fl In .FoundFiles
ActiveCell.Offset(1, 0).Activate
fName = Right(fl, Len(fl) - InStrRev(fl, "\"))
If InStr(fName, ".") Then
fName = Left(fName, InStrRev(fName, ".") - 1)
End If
fName = Replace(fName, "RD", "20", 1)
ActiveCell.Value = fName
Next 'fl
End With

End If
Range("B1").Clear 'Erases status prompt
End If
Application.EnableEvents = True
End Sub
---
Jay



"joecrabtree" wrote:

Yes you can do it that way, but I want to be able to integrate it into
an excel macro that I'm writing.

Regards

Joseph Crabtree





 
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
EXTRACT MONTH FROM DATE SSJ New Users to Excel 5 March 7th 08 05:55 PM
Extract Date christmaslog Excel Worksheet Functions 1 February 19th 06 10:28 AM
Extract Day of Week from Date in VBA GLT Excel Programming 7 December 13th 05 05:55 PM
extract name when a date in another cell gets near cityfc Excel Discussion (Misc queries) 1 November 9th 05 07:40 PM
extract date from the most current date Cali00 Excel Discussion (Misc queries) 1 April 13th 05 02:05 PM


All times are GMT +1. The time now is 03:46 PM.

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"