LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help in modifying a filesearch macro!


Hi all, seems like a nice place this!

I'm trying to get a macro that does the following:

Searches in a set folder for excel sheets
Lists them in a sheet
Makes the listed results hyperlinks to the listed sheet

WHich i have managed, and it works a treat.


Code
-------------------
Dim lCount As Long
Sheets("Existing Orders").Select
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False

On Error Resume Next
Range("B2").Select

With Application.FileSearch
.NewSearch
'Change path to suit
.LookIn = "J:\Purchase Orders\FM"
.FileType = msoFileTypeExcelWorkbooks
.Filename = "Order FM*.xls"
Range("B2").Select
If .Execute 0 Then 'Workbooks in folder
Range("B2").Select
For lCount = 1 To .FoundFiles.Count 'Loop through all.
Range("B2").Select
ActiveSheet.Hyperlinks.Add Anchor:=Cells(lCount, 1), Address:= _
.FoundFiles(lCount), TextToDisplay:= _
Replace(.FoundFiles(lCount), "J:\Purchase Orders\FM\", "")
Next lCount
End If
End With

On Error GoTo 0
Application.ScreenUpdating = True
Application.DisplayAlerts = True
Application.EnableEvents = True
Range("A1").Select
Sheets("Sheet1").Select
Range("A1").Select

End Su
-------------------


I have that running on workbook_open, and it's all fine.

But i really need to:

Specifiy which column and row the results start to show in - at th
moment it's A1, but it's going to be something i plan to roll ou
throughout the little company i work for so need it to look good (henc
not starting in the first column/row, so i can make it all pretty)

In the next column, call up a cell value from the sheet listed from th
filesearch.
For example, in column A it lists all the files found, but in B i wan
it to get cell value C4 from the sheets listed in column A. The shee
is an electronic ordering system (trying to convince the company t
reduce paper usage!) and the macro above lists all orders that hav
been placed. I would love to be able to list which Supplier it was sen
to next to the filesearch'd list of orders.

Any help would be immensely appreciated, thank you

--
druce
-----------------------------------------------------------------------
drucey's Profile: http://www.excelforum.com/member.php...fo&userid=3255
View this thread: http://www.excelforum.com/showthread.php?threadid=52347

 
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
Modifying Macro simplymidori[_2_] Excel Discussion (Misc queries) 3 April 13th 08 04:17 PM
Need help modifying a macro EAHRENS Excel Discussion (Misc queries) 13 March 31st 06 12:22 AM
Modifying Macro carl Excel Worksheet Functions 3 August 25th 05 08:45 PM
Filesearch in Remotely Called Macro Pat at ACS Excel Programming 2 July 7th 05 08:12 PM
FileSearch macro returning incorrect docs? Ed[_9_] Excel Programming 2 December 10th 03 05:48 PM


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