Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Decode from URL of hyperlink

I am copying some text from the browser which are actually
hyperlinks (text is hyperlinked).

When I paste it in Excel, the text is hyperlink and it is
linking to the web page, I want to go.

My requirement is to store the text & underlying hyperlink
URL separately in 2 columns. Is there a way to get the
hyperlink property (through macro or by any function)

Thanks in advance
Murali
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Decode from URL of hyperlink

One way to extract those URL's from a hyperlink is with a userdefinedfunction.

Here's one that may help:

Option Explicit
Function GetURL(Rng As Range) As String
Application.Volatile

Set Rng = Rng(1)

If Rng.Hyperlinks.Count = 0 Then
GetURL = ""
Else
GetURL = Rng.Hyperlinks(1).Address
End If
End Function

So if you had a hyperlink in A1, you could put =getURL(a1) in that adjacent
cell.

Then convert those formulas to values. Then use =hyperlink(b1) instead.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

And after you convert those formulas to values (edit|copy, edit|paste
special|values), you can delete the links from the other cells.

Select the cells and run this macro:

sub deletelinks()
selection.hyperlinks.delete
end sub



Murali Srinivasan wrote:

I am copying some text from the browser which are actually
hyperlinks (text is hyperlinked).

When I paste it in Excel, the text is hyperlink and it is
linking to the web page, I want to go.

My requirement is to store the text & underlying hyperlink
URL separately in 2 columns. Is there a way to get the
hyperlink property (through macro or by any function)

Thanks in advance
Murali


--

Dave Peterson

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
How to decode integer timestamps? Ron West Excel Worksheet Functions 8 November 19th 08 05:51 PM
decode renuka Excel Discussion (Misc queries) 3 November 1st 07 08:50 AM
serial number decode chiuinggum Excel Worksheet Functions 6 June 13th 06 09:15 AM
Intra-workbook hyperlink: macro/function to return to hyperlink ce marika1981 Excel Discussion (Misc queries) 3 May 6th 05 05:47 AM
reading html when hyperlink address not hyperlink text diplayed Kevin Excel Programming 1 December 4th 03 10:13 PM


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