none
VBA Macro: How do I extract hyperlinked cells into a new column? RRS feed

  • Question

  • Hopefully someone can help. I am new to VBA!

    So I am in the process of creating a Macro that creates a new "organized" file from an existing one.

    The existing File has a column with some hyperlinked number that, if you click on it, will lead you straight to a website (Say you clicked on the hyperlinked number 1, it will lead you to a website). 

    Currently, I have created a macro to make these numbers organized into column C of the new file.  


    What I want to do is to extract these hyperlinked addresses from column "C" of the new file (for the numbers that have hyperlinks) into column "I" of the new file of the corresponding row. 

    So say I have a hyperlinked number "2" in C3. I want to extract the hyperlink within the number (http://.....) into I3. Different column, but same row.

    Not all of them are hyperlinked however, so I need to find a macro that can distinguish hyperlinked and non-hyperlinked texts.

    Thank you in advance!

    Tuesday, February 11, 2014 3:21 PM

All replies

  • Re:  move cells with hyperlinks

    Do it the same way you would manually:   cut and paste.
    Note the space in the code line below.

      Worksheets("Sheet1").Range("C1:C30").Cut Worksheets("Sheet1").Range("I1:I30")
    '---
    Jim Cone
    Portland, Oregon USA
    https://goo.gl/IUQUN2 (Dropbox)
    (free & commercial excel add-ins & workbooks)

    • Edited by James Cone Sunday, October 30, 2016 7:40 PM
    Tuesday, February 11, 2014 4:09 PM