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: 5,934
Default Addendum to question

I think this macro will do what you want (just change the values I have
assigned in the Const statements to those for your actual setup)...

Sub MakeHyperlinks()
Dim FN As String
Dim RowLoc As Long

Const StartRow As String = 3
Const HyperlinkCol As String = "B"
Const SheetName As String = "Sheet4"
Const DirPath As String = "C:\TEMP\Test\" 'Note the backslash

FN = Dir(DirPath & "*.*")
RowLoc = StartRow
With Worksheets(SheetName)
Do While Len(FN) 0
.Hyperlinks.Add Anchor:=.Cells(RowLoc, HyperlinkCol), _
Address:=DirPath & FN, TextToDisplay:=FN
RowLoc = RowLoc + 1
FN = Dir
Loop
End With
End Sub

--
Rick (MVP - Excel)


"RickD" wrote in message
...
I meant file in the last sentence.

here is an example of what I want to do:

upon opening 8121.xls
directory j:\{name of directory to search} is searched and the filename
of all files found are entered into a table as hyper-links

HTH

RickD


"RickD" wrote in message
...
Using Excel 2003

I'd like to create a dynamic table of file names that are located in a
certain directory when the workbook opens and then be able to display,
with the default application, any one of the folders

Thanks in advance

RickD




 
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
Addendum to 2 digit year to 4 digit year RealGomer Excel Discussion (Misc queries) 2 December 14th 06 05:48 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 27th 05 07:46 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 23 April 23rd 05 09:26 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 22nd 05 03:30 PM
Addendum to "Subtotal has stopped working" Tim Mc Excel Worksheet Functions 0 March 4th 05 07:55 AM


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