View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Norman Jones
 
Posts: n/a
Default How can I copy/paste a hyperlink address without the link?

Hi Voluptas,

Try:
'=============
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet
Dim rng As Range
Dim rCell As Range
Dim iLastRow As Long
Dim HL As Hyperlink
Const col As String = "A:A" '<<==== CHANGE

Set WB = Workbooks("YourBook.xls") '<<==== CHANGE
Set SH = WB.Sheets("Sheet1") '<<==== CHANGE

iLastRow = Cells(Rows.Count, col).End(xlUp).Row
Set rng = SH.Range(Cells(1, col), Cells(iLastRow, col))

SH.Columns(col).Offset(, 1).Insert

For Each rCell In rng.Cells
With rCell
On Error Resume Next
.Offset(0, 1).Value = .Hyperlinks(1).Address
On Error GoTo 0
End With
Next rCell
End Sub
'<<=============

If you are not familiar with macros, you may wish to visit David McRitchie's
'Getting Started With Macros And User Defined Functions' at:

http://www.mvps.org/dmcritchie/excel/getstarted.htm


---
Regards,
Norman


"voluptas" wrote in message
...
I have a column of church names that have a hyperlink to their websites.
How
can I copy just the website links from the church names to create a
separate
website column?