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?
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?
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" <voluptas@discussions.microsoft.com> wrote in message
news:D1564D89-D742-45FE-821E-3937594D8889@microsoft.com...
>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?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks