Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create hyperlinks 1

Status
Not open for further replies.

henio

MIS
Jun 25, 2003
60
GB
Hi all,

I'm trying to create an index of files in a directory. I've managed to copy filenames into Excel, but I'd like them to be hyperlinks to the files. Can this be done?

tia,

Henio
 
Hi henio,

You're not giving us much to go on here, but if you have a list of filenames in column A, then select column B and type=HYPERLINK(A1) and enter it with <Ctrl><Enter>.

Enjoy,
Tony
 
To save you copying the filenames in here's a macro

Sub ListFiles()
'Before you run these macros, open a new worksheet and select the cell of the range _
into which you want the file names to be placed. To list different file types, you must _
modify the sample macros by changing the argument in the Dir() function. _
To return all Microsoft Excel add-in macros, replace &quot;*.XLS&quot; with &quot;*.XLA,&quot; and so on. _
The specified directory can be any valid directory. To search a different folder, change directory to the folder containing your Excel workbook files or you could add an inputbox to make it more interactive.

F = Dir(&quot;g:\*.xl*&quot;) '
Do While Len(F) > 0
ActiveCell.formula = F
ActiveCell.Offset(1, 0).Select 'By Columns
'ActiveCell.Offset(0, 1).Select 'By Rows
F = Dir()
Loop
End Sub

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top