+ Reply to Thread
Results 1 to 2 of 2

How can I copy/paste a hyperlink address without the link?

  1. #1
    voluptas
    Guest

    How can I copy/paste a hyperlink address without the link?

    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?

  2. #2
    Norman Jones
    Guest

    Re: 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" <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?




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1