ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating hyperlinks to network files (https://www.excelbanter.com/excel-programming/346606-creating-hyperlinks-network-files.html)

akronpow

Creating hyperlinks to network files
 

I am trying to create a macro so that I can click a button and
hyperlink is created, referencing a network location where the locatio
is dependent upon a value in another cell.

So for example, the hyperlink to be created in cell E3 would b
"=hyperlink("G:\General\Blah\Blah\"cell A9"\file.pdf")"

Also, I want the hyperlink text to just say "ABC"

How does this happen

--
akronpo
-----------------------------------------------------------------------
akronpow's Profile: http://www.excelforum.com/member.php...fo&userid=2910
View this thread: http://www.excelforum.com/showthread.php?threadid=48821


Dave Peterson

Creating hyperlinks to network files
 
Maybe...

=hyperlink("g:\general\blah\blah\" & A9 & "\file.pdf", "ABC")

akronpow wrote:

I am trying to create a macro so that I can click a button and a
hyperlink is created, referencing a network location where the location
is dependent upon a value in another cell.

So for example, the hyperlink to be created in cell E3 would be
"=hyperlink("G:\General\Blah\Blah\"cell A9"\file.pdf")"

Also, I want the hyperlink text to just say "ABC"

How does this happen?

--
akronpow
------------------------------------------------------------------------
akronpow's Profile: http://www.excelforum.com/member.php...o&userid=29100
View this thread: http://www.excelforum.com/showthread...hreadid=488213


--

Dave Peterson

akronpow[_2_]

Creating hyperlinks to network files
 

The resulting hyperlink formula is:

=HYPERLINK("G:\Real Estate\Shared\Offline Packages\& D5
&\PCR.PDF","PCR")

and I need the "& D5 &" part to show the result of cell D5.

Here is the code as used:

Range("H9").FormulaR1C1 = _
"=HYPERLINK(""G:\Real Estate\Shared\Offline Packages\& D5
&\PCR.PDF"",""PCR"")"


--
akronpow
------------------------------------------------------------------------
akronpow's Profile: http://www.excelforum.com/member.php...o&userid=29100
View this thread: http://www.excelforum.com/showthread...hreadid=488213


Dave Peterson

Creating hyperlinks to network files
 
Ah, you're populating the cell in code.

You may want to change the D5 to R5C4 since you're using R1C1 reference style
(or just use .formula).

And if you have trouble, you may need to make it look more like:

Range("H9").Formula = _
"=HYPERLINK(""file:////G:/Real Estate/Shared/Offline Packages/""" & _
"&D5&""/PCR.PDF"",""PCR"")"

akronpow wrote:

The resulting hyperlink formula is:

=HYPERLINK("G:\Real Estate\Shared\Offline Packages\& D5
&\PCR.PDF","PCR")

and I need the "& D5 &" part to show the result of cell D5.

Here is the code as used:

Range("H9").FormulaR1C1 = _
"=HYPERLINK(""G:\Real Estate\Shared\Offline Packages\& D5
&\PCR.PDF"",""PCR"")"

--
akronpow
------------------------------------------------------------------------
akronpow's Profile: http://www.excelforum.com/member.php...o&userid=29100
View this thread: http://www.excelforum.com/showthread...hreadid=488213


--

Dave Peterson


All times are GMT +1. The time now is 07:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com