+ Reply to Thread
Results 1 to 4 of 4

I need a macro to copy the hyperlink from one column to another

  1. #1
    Registered User
    Join Date
    11-07-2016
    Location
    Colorado
    MS-Off Ver
    2010
    Posts
    4

    I need a macro to copy the hyperlink from one column to another

    It has been too many years since I did any programming and never learned VBA and not interested in learning now.

    I have a list approximately 850 to 900 items long and need to copy the hyperlink in column C and use the same to create a hyperlink in column A, same row. I am thinking While-Wend would be the way to go in order to stop the macro if the active cell in column C is empty. I have already done a few rows with dead links and deleted the contents of column C at those rows. To give an example of what I'm working on here is a two row list:

    A (needs a hyperlink) B C (with hyperlink or deleted)
    Freewheeler Rig, by Bob McLellon – Date: 9/10/03 Freewheeler Rig by Bob McLellon – Date: 9/10/03
    Freewheeling Ideas, by Nason – Date: 9/10/06

    The purpose of what I'm working on, if it isn't obvious, is to separate the date from the title.

  2. #2
    Registered User
    Join Date
    11-07-2016
    Location
    Colorado
    MS-Off Ver
    2010
    Posts
    4

    Re: I need a macro to copy the hyperlink from one column to another

    Sorry, this didn't post the way I thought I would. "- Date: " followed by the date is supposed to be column B and everything else after is column C.

  3. #3
    Registered User
    Join Date
    11-07-2016
    Location
    Colorado
    MS-Off Ver
    2010
    Posts
    4

    Re: I need a macro to copy the hyperlink from one column to another

    Here is what I have been able to do (record):

    Selection.Hyperlinks(1).Address = "directory/filename (yes, this has been changed"
    ActiveCell.Offset(0, -2).Range("A1").Select
    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= "directory/filename", TextToDisplay:= "text to display"
    ActiveCell.Offset(1, 2).Range("A1").Select

    and how I think it needs to be:

    create a variable (for hyperlinks)
    possibly create a second variable (for hyperlink text to display)
    While (test current cell for not equal to empty)
    variable = hyperlink in the current cell
    ActiveCell.Offset(0, -2).Range("A1").Select
    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= variable (,possible second variable for text to display or leave unchanged)
    ActiveCell.Offset(1, 2).Range("A1").Select
    Wend
    Last edited by plz help; 11-11-2016 at 10:37 AM.

  4. #4
    Registered User
    Join Date
    11-07-2016
    Location
    Colorado
    MS-Off Ver
    2010
    Posts
    4

    Re: I need a macro to copy the hyperlink from one column to another

    Thanks but I figured it out!

    Sub Macro3()
    '
    ' Macro3 Macro
    '
    ' Keyboard Shortcut: Ctrl+z
    '
    Dim link As String

    While ActiveCell <> Empty
    link = Selection.Hyperlinks(1).Address
    ActiveCell.Offset(0, -2).Range("A1").Select
    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=link
    ActiveCell.Offset(1, 2).Range("A1").Select
    Wend
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to hyperlink and copy/paste value to 2nd worksheet???
    By AudreaBull in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2013, 05:27 AM
  2. [SOLVED] Macro to copy file Path with hyperlink.
    By visha_1984 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2013, 08:59 AM
  3. [SOLVED] Macro Help. Copy Hyperlink url from Column A and paste its image into Column B
    By kdela1212 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-04-2013, 09:00 AM
  4. VBA macro to copy hyperlink value to another worksheet
    By Jackcf in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2012, 08:31 PM
  5. Replies: 2
    Last Post: 10-08-2005, 12:05 PM
  6. [SOLVED] How to copy the hyperlink of a list of cells in another column
    By jaya in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-08-2005, 11:05 AM
  7. [SOLVED] How to copy the hyperlink of a list of cells in another column
    By jaya in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-08-2005, 11:05 AM
  8. Macro to Copy Hyperlink to another file as a HYPERLINK, not text...
    By dollardoc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-06-2005, 08:07 PM

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