Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,comp.apps.spreadsheets,microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Problems generating an html link based on worksheet values

I want to generate a hyper link based on text in a cell, for example
the cells D16 and D17 generate the text strings in F16 and F17, which
are valid filenames. I have two macros
MakeLink_file
MakeLink_datNum
that should both generate hyperlinks for me (source for these below),
however MakeLink_file does not work, whereas MakeLink_datNum does (I
want to use the more generic MakeLink_file version). Any ideas why
the simpler macro does not work?

Fred


D16 = 4383
D17 = 1267

F16 = \\FDR-server\General Pool\Beatrix\DATA SHEETS\FDR_PDF\4383 DAT
01.pdf
F17 = \\FDR-server\General Pool\Beatrix\DATA SHEETS\FDR_PDF\1267 DAT
01.pdf

This hyperlink does not work
E16 = MakeLink_file(F16)
= \\FDR-server\General Pool\Beatrix\DATA SHEETS\FDR_PDF\4383 DAT
01.pdf

This hyperlink does work
E17 =MakeLink_datNum(D17)
= \\FDR-server\General Pool\Beatrix\DATA SHEETS\FDR_PDF\1267 DAT
01.pdf

Public Function MakeLink_datNum( datNum)
'
' Macro recorded 2003-07-01 by Fred

MakeLink_datNum = "\\FDR-server\General Pool\Beatrix\DATA
SHEETS\FDR_PDF\" _
& datNum _
& " DAT 01.pdf"

ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=
MakeLink_datNum

Selection.Font.ColorIndex = 0

End Function

Public Function MakeLink_file( file)
'
' Macro recorded 2003-07-01 by Fred

MakeLink_file = file
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= file
Selection.Font.ColorIndex = 0

End Function
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
Add link to specific Excel worksheet in HTML Outlook message [email protected] Links and Linking in Excel 4 May 17th 23 11:47 AM
Documents move is generating link errors in Excel rtlemurs Excel Discussion (Misc queries) 0 June 25th 08 08:36 PM
Problems Creating html files with excel sheet Bigredno8 Excel Discussion (Misc queries) 1 July 5th 05 11:28 PM
Link based on worksheet name? tpmax Excel Worksheet Functions 1 March 19th 05 02:03 PM
Generating a Userform based on a worksheet Glenn Excel Discussion (Misc queries) 0 March 4th 05 08:25 PM


All times are GMT +1. The time now is 05:53 PM.

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"