Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Converting a value in a cell to a hyperlink in the same cell via V
I have a path to a file in cell B10. I want cell b10 to be converted to a
hyperlink without needing to point to a different cell (which I can do with the worksheet HYPERLINK function. I want to do this programmatically via VB. I have searched prior hyperlink questions and answers on this site but have found my case. Thanks, Sandy |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Converting a value in a cell to a hyperlink in the same cell via V
I turned on the macro recorder and then inserted a hyperlink. Turned off the
recorder and looked at the code Sub Macro1() ' ' Macro1 Macro ' Macro recorded 07/26/2006 by OGILVTW ' ' ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _ "http://www.cpearson.com/excel/duplicat.htm", TextToDisplay:= _ "http://www.cpearson.com/excel/duplicat.htm" End Sub this would tell me Sub MakeHyperlink() Range("B10").Hyperlinks.Add Anchor:=Range("B10"), _ Address:=Range("B10").Value, _ TextToDisplay:=Range("B10").Value End Sub which worked for me. -- Regards, Tom Ogilvy "Sandy" wrote: I have a path to a file in cell B10. I want cell b10 to be converted to a hyperlink without needing to point to a different cell (which I can do with the worksheet HYPERLINK function. I want to do this programmatically via VB. I have searched prior hyperlink questions and answers on this site but have found my case. Thanks, Sandy |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Converting a value in a cell to a hyperlink in the same cell via V
Tom, thank you. This almost works. It does create a hyperlink to the file in
question but does not open the file. A fly over of the link reveals that the following preceeds the path to the file: file///then the file path displays as expected. how do I get rid of the file/// Thank you "Sandy" wrote: I have a path to a file in cell B10. I want cell b10 to be converted to a hyperlink without needing to point to a different cell (which I can do with the worksheet HYPERLINK function. I want to do this programmatically via VB. I have searched prior hyperlink questions and answers on this site but have found my case. Thanks, Sandy |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Converting a value in a cell to a hyperlink in the same cell v
I don't know how it is getting there. I don't get that.
I put this URL in a B10 '\\Hqdadfs\data\COMMON\AA\Climate Assessment Survey.xls this was to a file on non-mapped network share (no drive letter). I ran the code and it creates a proper hyperlink that opens that file when it is clicked. I put in a path to a file on a mapped drive: C:\Data\aa_demo.xls that worked fine as well. -- Regards, Tom Ogilvy "Sandy" wrote: Tom, thank you. This almost works. It does create a hyperlink to the file in question but does not open the file. A fly over of the link reveals that the following preceeds the path to the file: file///then the file path displays as expected. how do I get rid of the file/// Thank you "Sandy" wrote: I have a path to a file in cell B10. I want cell b10 to be converted to a hyperlink without needing to point to a different cell (which I can do with the worksheet HYPERLINK function. I want to do this programmatically via VB. I have searched prior hyperlink questions and answers on this site but have found my case. Thanks, Sandy |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Converting a value in a cell to a hyperlink in the same cell via V
Again, thankyou. I assume you did your last test using the macro you created?
PS - I also live in VA (Lake Anna) "Sandy" wrote: I have a path to a file in cell B10. I want cell b10 to be converted to a hyperlink without needing to point to a different cell (which I can do with the worksheet HYPERLINK function. I want to do this programmatically via VB. I have searched prior hyperlink questions and answers on this site but have found my case. Thanks, Sandy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
converting text cell to numeric cell | Excel Discussion (Misc queries) | |||
Hyperlink from one.xlsx cell to another two.xlxs cell & click back | Excel Worksheet Functions | |||
How make hyperlink refer to cell content rather than cell address. | Excel Discussion (Misc queries) | |||
Copy hyperlink from one cell to/as hyperlink in another cell | Excel Worksheet Functions | |||
Using paste link infromation in cell to hyperlink to source cell? | Excel Worksheet Functions |