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: 3
Default Help to improve macro

Hi
I found this cool macro on this group that makes a list of all files in
a folder. With each file name in a separate row. I would be very
grateful if any one can make suitable changes so that each row contains
a hyper link to the file.
TIA

Unni

Sub ListIndexFiles()
'Lists all file names in the folder on the active sheet
Dim FileName As String
Dim r As Integer

'Range("a2:a5").ClearContents

r = 2
With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\Administrator\My
Documents"
.FileName = "*.doc"
If .Execute() 0 Then
For i = 1 To .FoundFiles.Count
FileName = Mid(.FoundFiles(i), 18)
Cells(r, 1) = FileName
r = r + 1
Next i
End If
End With
End Sub

 
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
Can you help me to improve this macro? Dario de Judicibus[_3_] Excel Programming 5 June 15th 05 10:59 AM
Improve code rjamison Excel Programming 0 June 14th 05 12:14 AM
Improve code Gareth Excel Programming 5 April 20th 05 03:41 PM
Need to improve a formula Brian Excel Worksheet Functions 2 December 9th 04 07:17 PM
Please help me improve macro to convert spreadsheet to tabular for Nigel Excel Programming 1 July 30th 04 02:54 PM


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