RE: "Basic File Search"



I modified my code to have a pop up window to select the folder rather then
have the folder hard coded


Sub test3()

Dim objShell As Object, objFolder As Object

Set objShell = CreateObject("Shell.Application")
On Error Resume Next

Set objFolder = objShell.BrowseForFolder(&H0&, "Select Folder ", &H1&)
If Not objFolder Is Nothing Then
Set oFolderItem = objFolder.Items.Item
folder = oFolderItem.Path

First = True
Do
If First = True Then
FName = Dir(folder & "\*.xls")
First = False
Else
FName = Dir()
End If
If FName <> "" Then
Workbooks.Open Filename:=folder & "\" & FName
End If
Loop While FName <> ""

End If

End Sub

"Fawn" wrote:

The books states to use the File Search command and when it displays the
"Basic File Search" task pane to type in AWI (which is short for awsome
images) which are the previous files I need to retreive on my thumb drive.
It then states that the box will be on the right of the screen and that I
should just select the drive I need and under that in a sub catorgory will be
the files I need. I am then to "arrange" them in a vertical fashion. So in
the end I will have the blank work and the 4 workbooks.

I hope this helps you. Thank you so much for your help

"Joel" wrote:

Are you looking in one directory or multiple directories? The DIR() function
may work. I need more details on your search to give you the right answer. I
have lots of code that does File Searches without the File Search function.
Are you just looking for names of files or are you looking at the dates as
well? I should be able to quickly give you the right code when I get the
details.

"Fawn" wrote:

I am in an excel class for school. We are learning out of an excel '03 book,
yet I have an '07 program. As part of my studies I am use the "File Search"
command. I used the interactive excel program and it stated that the '07
does not have this command. Yeah, I need help. I cannot finish this program
w/out this command. I need to use this to find 3 previous files created and
put them all into one new workbook
.



Relevant Pages

  • RE: Cycle through all folders under Mailbox
    ... The macro seems to crash on the first folder it goes to, ... Public Sub ProcessAllFolders() ... Dim fld As MAPIFolder ... Dim subfld As MAPIFolder ...
    (microsoft.public.outlook.program_vba)
  • *** TOUGH ONE *** Posting Form Results - using multiple selection boxes (ASP)
    ... I was changing the wrong files in the wrong folder. ... directory and the "_fpclass" folder that should be visible ... in the current web - folder view of FrontPage 2003. ... Sub FP_SetLocaleForPage ...
    (microsoft.public.frontpage.programming)
  • RE: Collect Info from Wkbks in a Folder with Criteria to 1 sheet.
    ... MsgBox ("Cannot open folder - Exiting Macro") ... Exit Sub ... Can you set a filter mechanism so that if ANY files in TEST FOLDER is ...
    (microsoft.public.excel.programming)
  • RE: Web Query Issue
    ... goes to next sub folder, i.e. the rest of htm files in current sub folder ... all htm files from Temporary Internet Files. ... you delete temporary internet files and view files. ...
    (microsoft.public.excel.misc)
  • Re: Default Template Folder Location
    ... It seems all bases have been covered, but you can force the print layout ... Sub Autonew() ... Web site www.gmayor.com Word MVP web site www.mvps.org/word ... folder is to be found. ...
    (microsoft.public.word.newusers)

Loading