A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Links and Linking
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Extract hyperlink string from excel cell



 
 
Thread Tools Display Modes
  #1  
Old January 19th, 2005, 07:46 PM
Ryan Sapien
external usenet poster
 
Posts: n/a
Default Extract hyperlink string from excel cell

Forgive my ignorance but I haven't done a lot of work with Excel VBA.
So do I just have to paste the function into the VBA window and then
add =HyperLinkText(CellName) on my worksheet cell?

Thanks

Ryan


Bill Manville wrote:
Markus Riester wrote:
Is there a function that is available (I didn't find one
in the standard functions Excel offers), or does anyone
have a macro?

Something like this?

Function HyperLinkText(oRange As Range) As String
Dim ST1 As String, ST2 As String
If oRange.Hyperlinks.Count = 0 Then Exit Function
ST1 = oRange.Hyperlinks(1).Address
ST2 = oRange.Hyperlinks(1).SubAddress
If ST2 "" Then ST1 = "[" & ST1 & "]" & ST2
HyperLinkText = ST1
End Function


Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup


  #2  
Old January 20th, 2005, 12:24 AM
Bill Manville
external usenet poster
 
Posts: n/a
Default

Ryan Sapien wrote:
So do I just have to paste the function into the VBA window and then
add =HyperLinkText(CellName) on my worksheet cell?


Yes
In the VB editor you need to Insert / Module if there are no standard
modules already in your workbook. Then paste the code into that
module.

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows in Taskbar Chevy General Discussion 8 October 15th, 2004 03:57 PM
How to display a very very large text in on Excel Cell Andy General Discussion 6 August 20th, 2004 01:14 PM
Linking to a specific sheet in HTML version of excel spreadsheet. ? rband General Discussion 4 August 5th, 2004 08:41 PM
Excel 2000 converts UNC links to relative - need to preserve UNC links! Jeff Adams Links and Linking 3 April 15th, 2004 05:46 PM
Convert a Cell Reference to Text Chuck Buker Worksheet Functions 6 September 22nd, 2003 05:04 PM


All times are GMT +1. The time now is 01:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.