Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default hyperlink file via macro?

Try this. change to suit your needs.

Dim cell As Range

For Each cell In Selection

ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="C:\testt\" &
cell.Value _
, TextToDisplay:=cell.Value
Next cell

End Sub



Chao

Cesar



"Lobo" wrote in message
...
Hi all,

I have a spreadsheet with a column of files

example:
Column A
Row 1 asdf.doc
Row 2 zxcv.xls
Row 3 qwer.doc

is there a way to make it so that If i click on a cell, that it will

automatically go to that file on the system?

I have 3 directories that the files can be possibly stored on based on

their type.
Lets say that my workbook is test.xls and it is located in C:\test.xls.
I have three files located in three directories
C:/directory1/asdf.doc
C:/directory2/zxcv.xls
C:/directory3/qwer.doc

I need to beable to click on a cell
for instance clicking on A1 which contains the text "asdf.doc"
and the macro will automatically search the 3 directories for asdf.doc and

then open the file.

Is this possible? Any help would be grand.

-Lobo



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default hyperlink file via macro?

thanks, it work

i have to try change it as needed hehe
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
update the hyperlink in file after changing the file name Bel71 Excel Worksheet Functions 3 May 11th 10 03:47 PM
Macro to insert a hyperlink to external file dadouza Excel Discussion (Misc queries) 2 August 1st 08 01:27 AM
why is absolute hyperlink in XLS file changed when file is saved SusanJ Excel Discussion (Misc queries) 3 August 17th 07 02:24 AM
Turning a text file name into a search and linking the file as a hyperlink AlistairM Excel Discussion (Misc queries) 1 January 26th 06 04:55 AM
Intra-workbook hyperlink: macro/function to return to hyperlink ce marika1981 Excel Discussion (Misc queries) 3 May 6th 05 05:47 AM


All times are GMT +1. The time now is 03:02 AM.

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"