Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 68
Default Hyperlink Relative Reference

I'm using about 100 3D pdf instruction files that are automatically linked in
a spreadsheet. The spreadsheet is small, but the instructions are large.
And the spreadsheet gets copied from project to project (folder to folder).
I don't want to clutter the server with these instructions plus when I'm
updating the instructions, I only want to do it once so everyone has access
to them instantly.

Is there any way to make the hyperlink function relative? In other words,
when I click on it, it will go to the root directory of the drive where the
current file is (p:\) and the up to a set location (P:\Instructions)? It
shouldn't matter how many folders deep the current file is. It just needs to
go up to the top and then down from there. And it can't matter what
different users name the drive, plus there are multiple servers in different
offices, so the root directory name will be variable.

Maybe this is too much for this site to handle, but I thought I would try.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,069
Default Hyperlink Relative Reference

This user-defined function (UDF) returns the drive where ThisWorkbook (the
workbook with the code) is saved. It can return a letter (D:) if the drive is
mapped that way, or the server path (\\rwkflp06.il.mycompany.com\thutch). It
should work either way. If you create your hyperlinks using the HYPERLINK
function, you can call the UDF like this:

=HYPERLINK(GetDrive() & "\Instructions\Help1.pdf","Display this text")

Here is the UDF, which needs to be pasted into a VBA module in your workbook:

Public Function GetDrive() As Variant
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(ThisWorkbook.FullName)
GetDrive = f.Drive
End Function

If you are new to user-defined functions (macros), this link to Jon
Peltier's site may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

Hope this helps,

Hutch

"TKS_Mark" wrote:

I'm using about 100 3D pdf instruction files that are automatically linked in
a spreadsheet. The spreadsheet is small, but the instructions are large.
And the spreadsheet gets copied from project to project (folder to folder).
I don't want to clutter the server with these instructions plus when I'm
updating the instructions, I only want to do it once so everyone has access
to them instantly.

Is there any way to make the hyperlink function relative? In other words,
when I click on it, it will go to the root directory of the drive where the
current file is (p:\) and the up to a set location (P:\Instructions)? It
shouldn't matter how many folders deep the current file is. It just needs to
go up to the top and then down from there. And it can't matter what
different users name the drive, plus there are multiple servers in different
offices, so the root directory name will be variable.

Maybe this is too much for this site to handle, but I thought I would try.

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 68
Default Hyperlink Relative Reference

Tom,

I only just now reprogrammed our template using your suggestion. This works
great. Thanks!

Mark.

"Tom Hutchins" wrote:

This user-defined function (UDF) returns the drive where ThisWorkbook (the
workbook with the code) is saved. It can return a letter (D:) if the drive is
mapped that way, or the server path (\\rwkflp06.il.mycompany.com\thutch). It
should work either way. If you create your hyperlinks using the HYPERLINK
function, you can call the UDF like this:

=HYPERLINK(GetDrive() & "\Instructions\Help1.pdf","Display this text")

Here is the UDF, which needs to be pasted into a VBA module in your workbook:

Public Function GetDrive() As Variant
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(ThisWorkbook.FullName)
GetDrive = f.Drive
End Function

If you are new to user-defined functions (macros), this link to Jon
Peltier's site may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

Hope this helps,

Hutch

"TKS_Mark" wrote:

I'm using about 100 3D pdf instruction files that are automatically linked in
a spreadsheet. The spreadsheet is small, but the instructions are large.
And the spreadsheet gets copied from project to project (folder to folder).
I don't want to clutter the server with these instructions plus when I'm
updating the instructions, I only want to do it once so everyone has access
to them instantly.

Is there any way to make the hyperlink function relative? In other words,
when I click on it, it will go to the root directory of the drive where the
current file is (p:\) and the up to a set location (P:\Instructions)? It
shouldn't matter how many folders deep the current file is. It just needs to
go up to the top and then down from there. And it can't matter what
different users name the drive, plus there are multiple servers in different
offices, so the root directory name will be variable.

Maybe this is too much for this site to handle, but I thought I would try.

Thanks!

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
More Hyperlink Cell 'Relative' Questions cncf Excel Discussion (Misc queries) 4 June 3rd 08 05:52 PM
hyperlink - PDF file - relative reference eugene Excel Worksheet Functions 4 November 10th 07 01:59 PM
CAN A HYPERLINK HAVE AN ABSOLUTE COLUMN & RELATIVE CELL REFERENCE. june.sidwell Excel Worksheet Functions 1 December 27th 06 08:54 PM
Using an offset formula for the reference in a relative reference Cuda Excel Worksheet Functions 6 November 15th 06 05:12 PM
Hyperlink- relative reference jjbf22 Excel Worksheet Functions 0 April 27th 06 03:15 PM


All times are GMT +1. The time now is 06:12 PM.

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"