Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Wild Card Search Excel 2003

Hi All,

I am using the following function to search a folder and display all
of its PDF files as hyperlinks using the following module. I would now
like to change it where it could prompt a user for input say a name
segment of a file. If a file is say Bright Works they coud enter
*right and the module would search the folders & sub-folders and
display the PDF for Bright Works .

Thanks in advance for all your help,here is the module:


Sub Prior_Turbine_A()
Dim i As Long
With Application.FileSearch
.NewSearch
.SearchSubFolders = True
.Filename = "*.pdf"
.LookIn = "I:\Prior_Turbine_A"
.Execute
For i = 1 To .FoundFiles.Count
ActiveSheet.Hyperlinks.Add Anchor:=Range("A" & i), _
Address:=.FoundFiles(i), TextToDisplay:= _
Right(.FoundFiles(i), Len(.FoundFiles(i)) - _
InStrRev(.FoundFiles(i), "\"))
Next
End With
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Wild Card Search Excel 2003

try something like this:

Sub Prior_Turbine_A()
Dim i As Long
Dim strSearch As String

strSearch = InputBox("Enter search string")

With Application.FileSearch
.NewSearch
.SearchSubFolders = True
.FileType = msoFileTypeAllFiles
.Filename = "*" & strSearch & "*.pdf"
.LookIn = "I:\Prior_Turbine_A"
.Execute
For i = 1 To .FoundFiles.Count
ActiveSheet.Hyperlinks.Add Anchor:=Range("A" & i), _
Address:=.FoundFiles(i), TextToDisplay:= _
Right(.FoundFiles(i), Len(.FoundFiles(i)) - _
InStrRev(.FoundFiles(i), "\"))
Next
End With
End Sub



--
Hope that helps.

Vergel Adriano


" wrote:

Hi All,

I am using the following function to search a folder and display all
of its PDF files as hyperlinks using the following module. I would now
like to change it where it could prompt a user for input say a name
segment of a file. If a file is say Bright Works they coud enter
*right and the module would search the folders & sub-folders and
display the PDF for Bright Works .

Thanks in advance for all your help,here is the module:


Sub Prior_Turbine_A()
Dim i As Long
With Application.FileSearch
.NewSearch
.SearchSubFolders = True
.Filename = "*.pdf"
.LookIn = "I:\Prior_Turbine_A"
.Execute
For i = 1 To .FoundFiles.Count
ActiveSheet.Hyperlinks.Add Anchor:=Range("A" & i), _
Address:=.FoundFiles(i), TextToDisplay:= _
Right(.FoundFiles(i), Len(.FoundFiles(i)) - _
InStrRev(.FoundFiles(i), "\"))
Next
End With
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Wild Card Search Excel 2003

On Aug 2, 6:16 pm, Vergel Adriano
wrote:
try something like this:

Sub Prior_Turbine_A()
Dim i As Long
Dim strSearch As String

strSearch = InputBox("Enter search string")

With Application.FileSearch
.NewSearch
.SearchSubFolders = True
.FileType = msoFileTypeAllFiles
.Filename = "*" & strSearch & "*.pdf"
.LookIn = "I:\Prior_Turbine_A"
.Execute
For i = 1 To .FoundFiles.Count
ActiveSheet.Hyperlinks.Add Anchor:=Range("A" & i), _
Address:=.FoundFiles(i), TextToDisplay:= _
Right(.FoundFiles(i), Len(.FoundFiles(i)) - _
InStrRev(.FoundFiles(i), "\"))
Next
End With
End Sub

--
Hope that helps.

Vergel Adriano



" wrote:
Hi All,


I am using the following function to search a folder and display all
of its PDF files as hyperlinks using the following module. I would now
like to change it where it could prompt a user for input say a name
segment of a file. If a file is say Bright Works they coud enter
*right and the module would search the folders & sub-folders and
display the PDF for Bright Works .


Thanks in advance for all your help,here is the module:


Sub Prior_Turbine_A()
Dim i As Long
With Application.FileSearch
.NewSearch
.SearchSubFolders = True
.Filename = "*.pdf"
.LookIn = "I:\Prior_Turbine_A"
.Execute
For i = 1 To .FoundFiles.Count
ActiveSheet.Hyperlinks.Add Anchor:=Range("A" & i), _
Address:=.FoundFiles(i), TextToDisplay:= _
Right(.FoundFiles(i), Len(.FoundFiles(i)) - _
InStrRev(.FoundFiles(i), "\"))
Next
End With
End Sub- Hide quoted text -


- Show quoted text -


Thanks Vergel, it works great, have a great day and again thanks for
your help.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Wild Card Search Excel 2003

On Aug 3, 8:47 am, wrote:
On Aug 2, 6:16 pm, Vergel Adriano





wrote:
try something like this:


Sub Prior_Turbine_A()
Dim i As Long
Dim strSearch As String


strSearch = InputBox("Enter search string")


With Application.FileSearch
.NewSearch
.SearchSubFolders = True
.FileType = msoFileTypeAllFiles
.Filename = "*" & strSearch & "*.pdf"
.LookIn = "I:\Prior_Turbine_A"
.Execute
For i = 1 To .FoundFiles.Count
ActiveSheet.Hyperlinks.Add Anchor:=Range("A" & i), _
Address:=.FoundFiles(i), TextToDisplay:= _
Right(.FoundFiles(i), Len(.FoundFiles(i)) - _
InStrRev(.FoundFiles(i), "\"))
Next
End With
End Sub


--
Hope that helps.


Vergel Adriano


" wrote:
Hi All,


I am using the following function to search a folder and display all
of its PDF files as hyperlinks using the following module. I would now
like to change it where it could prompt a user for input say a name
segment of a file. If a file is say Bright Works they coud enter
*right and the module would search the folders & sub-folders and
display the PDF for Bright Works .


Thanks in advance for all your help,here is the module:


Sub Prior_Turbine_A()
Dim i As Long
With Application.FileSearch
.NewSearch
.SearchSubFolders = True
.Filename = "*.pdf"
.LookIn = "I:\Prior_Turbine_A"
.Execute
For i = 1 To .FoundFiles.Count
ActiveSheet.Hyperlinks.Add Anchor:=Range("A" & i), _
Address:=.FoundFiles(i), TextToDisplay:= _
Right(.FoundFiles(i), Len(.FoundFiles(i)) - _
InStrRev(.FoundFiles(i), "\"))
Next
End With
End Sub- Hide quoted text -


- Show quoted text -


Thanks Vergel, it works great, have a great day and again thanks for
your help.- Hide quoted text -

- Show quoted text -


Vergel,

One more thing, how can I modify the above code so that the hyperlinks
are sorted in a decending order.

thanks agin in advance!!!

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
Wild Card Search fi.or.jp.de Excel Worksheet Functions 2 August 3rd 09 07:56 PM
Replacing wild card characters in EXCEL arjay010 Excel Discussion (Misc queries) 2 June 29th 07 02:07 AM
Text wild card search chad Excel Worksheet Functions 1 November 20th 06 07:10 PM
sumproduct with a search and wild card Scorpvin Excel Discussion (Misc queries) 1 June 14th 06 04:46 PM
Wild Card Search roy.okinawa Excel Worksheet Functions 4 January 30th 06 10:42 PM


All times are GMT +1. The time now is 10:14 PM.

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

About Us

"It's about Microsoft Excel"