Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

Converting Hyperlink formulae to real hyperlink

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Darin Kramer - 19 Sep 2007 13:07 GMT
Hi there,

I have the following formulae =HYPERLINK("mailto:"&J2,A2)
which creates a working hyperlink.
Problem is I need to move this data to another spreadsheet - If I copy
and paste values it looses the hyperlinking abilities...
question How can I take this hyperlinked formulae and paste it as a
value (ie that does not refer to the other cells), but still works as a
hyperlink...

Regards

D
Tom Ogilvy - 19 Sep 2007 13:44 GMT
worksheets("sheet2").Formula =
 "=Hyperlink(""mailtto:""&Sheet1!J2,Sheet1!A2)"

create a hyperlink with the macro recorder on.  Turn it off, then look at
the recorded code.  Get the information from your source sheet to supply to
the arguments of the code you recorded.  

Signature

Regards,
Tom Ogilvy

> Hi there,
>
[quoted text clipped - 11 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***
Gary''s Student - 19 Sep 2007 14:10 GMT
Assuming that your hyperlink formulas all have the same format (one cell to
carry the email address and another cell to carry the display name), then:

Sub hyper_verter()
'
'   gsnu
'
dq = Chr(34)
v = Selection.Formula
v = Replace(v, dq, "")
v = Replace(v, " ", "")
v = Replace(v, "=HYPERLINK(mailto:&", "")
v = Replace(v, ")", "")

st = Split(v, ",")
part1 = Range(st(0)).Value
part2 = Range(st(1)).Value

Sheets("Sheet2").Activate
Set r = Range("B9")
With ActiveSheet
.Hyperlinks.Add Anchor:=r, Address:="mailto:" & part1, TextToDisplay:=part2
End With
End Sub

this macro:

1. gets the formula from the Selected cell
2. gets the address references from the formula
3. gets the email address and display name from the references
4. goes to Sheet2
5. inserts a non-formula hyperlink in cell B9

Put whatever looping structure around this code you desire.
Signature

Gary''s Student - gsnu2007

> Hi there,
>
[quoted text clipped - 11 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***
Darin Kramer - 19 Sep 2007 16:17 GMT
Gary - it gets stuck on the part 1....?

My hyperlink formulae is in column K - I wouldent mind the resutl in
column L...

Regards

D
Gary''s Student - 19 Sep 2007 19:40 GMT
Try to  duplicate my results in a new blank worksheet:

1. in A2 I entered:
jimmy

2. in J2 I entered:
james.ravenswood@princeton.edu

3. in A5 I entered:
=HYPERLINK("mailto:" & J2,A2)

This link is "hot".  Clicking it generates an email

4. I selected A5 and ran the macro and got a hyperlink on Sheet2 which was
also hot

Signature

Gary''s Student - gsnu200745

> Gary - it gets stuck on the part 1....?
>
[quoted text clipped - 6 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***
Darin Kramer - 20 Sep 2007 16:45 GMT
Gary,

For whatever (unknown!) reason, mine stops on the line Part 1!!!

Regards

D
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.