Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 355
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 355
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 355
Default 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
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
converting text cell to numeric cell SM Excel Discussion (Misc queries) 5 August 11th 09 03:32 PM
Hyperlink from one.xlsx cell to another two.xlxs cell & click back Bobbi-Joe Excel Worksheet Functions 1 August 7th 09 07:18 PM
How make hyperlink refer to cell content rather than cell address. Omunene Excel Discussion (Misc queries) 3 March 2nd 06 01:07 AM
Copy hyperlink from one cell to/as hyperlink in another cell YogS Excel Worksheet Functions 6 January 12th 06 11:57 PM
Using paste link infromation in cell to hyperlink to source cell? Wayne Excel Worksheet Functions 7 February 27th 05 07:38 PM


All times are GMT +1. The time now is 04:40 AM.

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"