Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copying hyperlinks

Does anyone know how to write the VBA code copy a
hyperlink I tried to record a macro where I select a cell
that has a hyperlink. I choose edit HYPERLINK, COPY
HYPERLINK and then I select cell and paste.

here is the code it generates.


Sub Macro2()
'
' Macro2 Macro
' Macro recorded 4/29/2004 by JOHN F SHARKEY
'

'
Range("A8").Select
Selection.Copy
Range("E8").Select
ActiveSheet.Paste
End Sub
Any way around this?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default copying hyperlinks

Hi John,
for the simplest in the form of a user defined function:

Function HyperlinkAddress(cell)
On Error Resume Next
HyperlinkAddress = cell.Hyperlinks(1).Address
if hyperlinkaddress = 0 then hyperlinkaddress = ""
End Function

For some additional codings for other links, see
http://www.mvps.org/dmcritchie/excel/buildtoc.htm#url
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"john sharkey" wrote ...
Does anyone know how to write the VBA code copy a hyperlink



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
Copying Hyperlinks by column N Walton Excel Discussion (Misc queries) 0 July 17th 09 11:38 AM
Copying hyperlinks Eric Excel Discussion (Misc queries) 1 June 14th 07 10:54 PM
Copying Hyperlinks Tim Excel Discussion (Misc queries) 3 April 6th 06 09:58 PM
Problem with copying Hyperlinks Gaurav Excel Discussion (Misc queries) 0 November 27th 05 11:53 AM
hyperlinks and copying a worksheet kimare Excel Worksheet Functions 1 November 23rd 04 03:43 PM


All times are GMT +1. The time now is 09:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"