+ Reply to Thread
Results 1 to 8 of 8

Lookup Hyperlink and go to Address with Macro

  1. #1
    Registered User
    Join Date
    11-22-2011
    Location
    Edinburgh
    MS-Off Ver
    Excel 2003
    Posts
    17

    Lookup Hyperlink and go to Address with Macro

    Sorry if this title is terrible, I am struggling to world exactly what I am looking for, probably why I can't find a solution anywhere else despite searching for the past 2 hours!

    I currently have a VLOOKUP returning a URL and I have used the HYPERLINK function to format as a hyperlink as follows:

    =HYPERLINK(VLOOKUP(A1,'Current Position'!$A$1:$C$2,3,FALSE)

    I thought it would then be very simple to THEN use a macro from a button to then go to that URL however when I use the lookup the macro fails. Having the cell as just the plain URL without the LOOKUP works find, weirdly.

    Here's the code I am using.

    Please Login or Register  to view this content.
    I assume there must be something wrong with the format of the cell i.e. it is not recognised as a Hyperlink?

    Hope someone can help.

    Thanks
    Chris
    Last edited by cfherd; 02-07-2012 at 12:52 PM.

  2. #2
    Registered User
    Join Date
    11-22-2011
    Location
    Edinburgh
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Lookup Hyperlink and go to Address with Macro

    Sorry to bump but anyone have any ideas on this?

  3. #3
    Registered User
    Join Date
    04-25-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Lookup Hyperlink and go to Address with Macro

    Can you post your file? I did an example on mine and it worked fine.

  4. #4
    Registered User
    Join Date
    11-22-2011
    Location
    Edinburgh
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Lookup Hyperlink and go to Address with Macro

    Thanks for the reply! Thought it should work...how do I post my file?

  5. #5
    Registered User
    Join Date
    04-25-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Lookup Hyperlink and go to Address with Macro

    When you press reply there's an icon with a paperclip and paper (Attachments) and there you can upload your Excel file.

  6. #6
    Registered User
    Join Date
    11-22-2011
    Location
    Edinburgh
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Lookup Hyperlink and go to Address with Macro

    Hopefully this works!
    Attached Files Attached Files

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Lookup Hyperlink and go to Address with Macro

    Hello cfherd,

    There are a few preventing this from working. First the your named range "Current_Position" is not dynamic and second the "Search" button is a little more complex than you thought. Also the formula in B5 should be using "Current_Position"

    Current_Position Formula

    =OFFSET('Current Position'!$A:$C,1,0,COUNTA('Current Position'!A:A)-1,3)

    B5 Formula

    =HYPERLINK(VLOOKUP(B2,Current_Position,3,FALSE))

    Search Button Code
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  8. #8
    Registered User
    Join Date
    11-22-2011
    Location
    Edinburgh
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Lookup Hyperlink and go to Address with Macro

    Works perfectly thank you! I need to add a little functionality around if the vlookup returns an #N/A or no agreement number is entered but I've done something like that before so I'll just try and adapt that to work with the code...I may be back!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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