View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
dd dd is offline
external usenet poster
 
Posts: 95
Default Hyperlink question

I can see where you're going with a worksheet selection change event. I
don't understand how I link D8 to Z8, when the cell already contains a
hyperlink to the external file.

What does this do?
file1.arg
fil4.narfl
procedure.qwerty

My workbook contains code to find and populate the sheet with files found of
a specific filetype.

My hyperlinks start on Row 8 and are made up of adding together Cell
B3+A8+B8+C8 (or whatever Row it is)

"Gary''s Student" wrote in message
...
Let's say in A1 thru A20 we have a list of hyperlinks. They are all set to
place in this documents. The "friendly" names are the file names:

file1.arg
fil4.narfl
procedure.qwerty
..
..
..


So column A has both hyperlinks and the desired filenames/types
A1 links to Z1
A2 links to Z2
A3 links to Z3
..
..
..

So clicking on A1 just takes you to Z1.

We also have the following Event macro in worksheet code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Range("Z:Z"), Target) Is Nothing Then
Exit Sub
End If
v = Cells(Target.Row, 1).Value
s = Application.InputBox("Enter Path for file save", 2)
ChDir s
If Right(s, 1) < "\" Then
s = s & "\"
End If
ActiveWorkbook.SaveAs Filename:=s & v
End Sub

So clicking on A1 gets us to Z1 and getting to Z1 trips the macro. The user
supplies the path and column A supplies the filename
--
Gary''s Student
gsnu200705


"dd" wrote:

I have a list of hyperlinks - to an unusual filetype. When the user
clicks
on a link, a message box appears stating "unable to open file".

I want to set it up so that excel asks the user where to save the file,
rather than try to open it.

Regards
Dylan