Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have some code that searches files with specific contents within the file and returns the file name to a selection box. The selection box currently contains the file name. I am needing it to also include the modified date within this box. Here is the code i'm currently using. Can any help me with getting the modified date added in as part of the information provided. Thank you, Michael Sub Locatefile() Dim I As Integer Worksheets("Data").Select Cells.Select Application.CutCopyMode = False Selection.Delete Shift:=xlUp Range("A1").Select 5 si = Worksheets("Setup").Range("C4") Path = Worksheets("Setup").Range("F3") With Application.FileSearch ..NewSearch ..LookIn = Path ..TextOrProperty = "COST CENTER = " & si ..MatchTextExactly = True ..Filename = "*.txt" ..Execute If .FoundFiles.Count = 0 Then GoTo 5 For I = 1 To .FoundFiles.Count If .FoundFiles.Count = 1 Then Workbooks.Open .FoundFiles(I) End If If .FoundFiles.Count 1 Then UserForm1.ComboBox1.AddItem .FoundFiles(I) End If Next End With UserForm1.Show foundfileopen End Sub -- Michael Wise ------------------------------------------------------------------------ Michael Wise's Profile: http://www.excelforum.com/member.php...fo&userid=6998 View this thread: http://www.excelforum.com/showthread...hreadid=557334 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Date Last Modified | Excel Worksheet Functions | |||
Last Modified Date help... | Excel Programming | |||
date that a row is modified | Excel Discussion (Misc queries) | |||
date modified | Excel Discussion (Misc queries) | |||
modified date | Excel Programming |