Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Ryan Sapien
 
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   Report Post  
Bill Manville
 
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

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
can't move a named cell without breaking a hyperlink to that cell Snakeye Links and Linking in Excel 3 January 27th 05 12:57 AM
Excel converts Mapped drive to UNC - How to stop? Fred Links and Linking in Excel 1 January 20th 05 01:24 AM
Excel 2003 hyperlink problem GregL Links and Linking in Excel 0 January 16th 05 05:03 AM
Hyperlink to specific sheet in Excel Web File jd17 Links and Linking in Excel 0 December 8th 04 10:03 PM


All times are GMT +1. The time now is 06:01 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"