+ Reply to Thread
Results 1 to 2 of 2

Macro to separate and open hyperlinks

  1. #1
    Forum Contributor
    Join Date
    03-27-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    290

    Macro to separate and open hyperlinks

    I have a document with a bunch of hyperlinks refering to database entries. When I try to click on them to open them from Excel I get an internal message stating that it could be used in a scripting attack, but im trying to find a work around this.

    if i edit the hyperlink and copy and paste the hyperlink into my browser it works fine, its just when i click the hyperlink.

    Im looking for a way to separate the hyperlink and put it in the adjacent cell and then by use of a macro, open the link. is this possible?

  2. #2
    Forum Contributor
    Join Date
    03-27-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: Macro to separate and open hyperlinks

    Hello Penfold1992, here is your answer! (lol)

    For the first part of the question, (to separate the hyperlink and put it in the adjacent cell by use of a macro) you can use this macro:

    Please Login or Register  to view this content.
    and for the second part of your question: open the hyperlink via VBA you can use this macro...
    Please Login or Register  to view this content.
    I have set this to a key so that I can highlight the cell with the hyperlink and just press ctrl+m but you can link it to a button or however you wish.
    This works without having to separate the hyperlink from the macro, if you want to still separate the hyperlink you can use this:
    Please Login or Register  to view this content.
    this time the active cell would be the new cell with the hyperlink in it... if you wish to click on the original cell and use the macro you can alternatively replace r = ActiveCell.Value with ActiveCell.Offset(0,1).Value

    or to be even more complex you can search for a hyperlink! but I think its possible to figure that out on your own...

    Kind Regards,
    Me. =)

+ 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