+ Reply to Thread
Results 1 to 11 of 11

Macro to read another cells hyperlink address

  1. #1
    Registered User
    Join Date
    01-02-2014
    Location
    Santa Rosa, CA
    MS-Off Ver
    Excel 2010
    Posts
    20

    Macro to read another cells hyperlink address

    Hello,

    In my workbook on the front tab 'Draw Request' people will be entering a 4 digit number in cells B13-B38. When they do I would like the corresponding column Q cell to return either OK or NO if the 4 digit number can be found in column K on my back tab titled 'Photo Tracking'.

    If it returns OK I would like to be able to click OK and have it open the same hyperlink that is in column C of the same row as the 4 digit number on 'Photo 'Tracking. (I.E. I enter the number 0740 in 'Draw Request' B13, column Q returns OK because on 'Photo Tracking' the number 0740 is found in K5 and when I click the OK it opens the same hyperlink that is in 'Photo Tracking' C5.)

    Currently I am using this formula
    =IF(ISBLANK(B13),"",IF(ISNA(VLOOKUP("*"B13&"*",'Photo Tracking'!K5:K93,1,FALSE)),"NO",HYPERLINK(INDEX('Photo Tracking'!C:C,MATCH("*"&'Draw Request'!B13&"*",'Photo Tracking'!K:K,0)),"OK")))

    Now, when I go to the 'Photo Tracking tab' and right-click cell C5 to hyperlink to a document titled "1 Loretta.xlsx" the equation works perfectly. I can type 0740 into cell B13 on 'Draw Request', Q13 will return OK and when I click OK, 1 Loretta will open up.

    However, in the 'Photo Tracking' tab I don't want to display 1 Loretta.xlsx in cell C5, I would like to display the number 4. When I type 4 and click cell C5 the hyperlink still works, but when I return to the 'Draw Request' tab and click the OK in cell Q13, I get the error message "Cannot open the specified file".

    I know I need to use a macro to tell the formula to read another cell's hyperlink target address, unfortunately I have no idea how to do this.

    Any help provided would be greatly appreciated.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to read another cells hyperlink address

    Please post a sample workbook - include enough desensitized data so that we can see the extent of your request
    (Click on "Go Advanced" and then on the paper clip)
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    01-02-2014
    Location
    Santa Rosa, CA
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Macro to read another cells hyperlink address

    Sample Workbook.xlsx

    I hope this worked and is enough data.

    The hyperlinks wont work but they are the numbers 3 in the Week column on 'Photo Tracking'.

    Thanks for the assistance.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to read another cells hyperlink address

    If no one solves this in the interim, I'll look at it tomorrow

  5. #5
    Registered User
    Join Date
    01-02-2014
    Location
    Santa Rosa, CA
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Macro to read another cells hyperlink address

    I have actually figured this out and have a working macro.

    Now I am wondering how I can get the formula to read from the bottom-top, rather than top-bottom.

    I would like for it to start at the bottom of column K on 'Photo Tracking' and go up, but I'm not exactly sure how to do that.

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to read another cells hyperlink address

    Thanks for the rep - I don't know how to write a formula and certainly not one like that, so I've asked the other contributors to help you

  7. #7
    Registered User
    Join Date
    01-02-2014
    Location
    Santa Rosa, CA
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Macro to read another cells hyperlink address

    Xladept,

    Thank you for your assistance. The current formula I'm using is:
    =IF(ISBLANK(B13),"",IF(ISNUMBER(MATCH("*"&'Draw Request'!B13&"*",'Photo Tracking'!K:K,0)),HYPERLINK(gethyperlinkaddress(INDEX('Photo Tracking'!C:C,MATCH("*"&'Draw Request'!B13&"*",'Photo Tracking'!K:K,0))),"OK"),"NO"))

    gethyperlinkaddress is the macro I have created. I am looking for a way to have it search column K of 'Photo Tracking' from newest entry to latest.

    Any help would be greatly appreciated.

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Macro to read another cells hyperlink address

    Upload a fresh file with your formulas and add your comments nearby the expected result and explain how you are arriving it with sheet/range references.

    Ensure that your formula's are not returning any missing range errors like the below.

    =IF(ISBLANK(B20),"",VLOOKUP(B20,#REF!,2,FALSE))


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  9. #9
    Registered User
    Join Date
    01-02-2014
    Location
    Santa Rosa, CA
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Macro to read another cells hyperlink address

    Sample Workbook.xlsm
    Sorry about that, I have attached an updated workbook.

    Currently you can enter a 4 digit line number into cells B13:B38 on the tab 'Draw Request' and the formula in column Q will tell you if that line # exists in column K of 'Photo Tracking". If those numbers are there the formula returns an "OK" if they are not, it returns a "NO".

    If an "OK" returns, you can click the cell and it will open the corresponding hyperlink in column C of 'Photo Tracking'. Currently the formula is starting at the top of column K and searching for the first iteration of that 4 digit number, and returning the link that is in cell C of that row. However, what I would like it to do is start at the bottom of column K and return the hyperlink of the most recent iteration of the 4 digit line #.

    I am looking for something I can add/change to my formula in cells Q13:Q38 of 'Draw Request' that will tell the formula to search from the bottom of column K of 'Photo Tracking' to the top.

    Thank you for your time.
    Attached Files Attached Files
    Last edited by NBrown1; 09-20-2014 at 03:12 PM.

  10. #10
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Macro to read another cells hyperlink address

    In Q13 Cell of Draw Request Sheet


    =IF(B13="","",IF(COUNTIF('Photo Tracking'!K:K,"*"&B13&"*"),HYPERLINK(gethyperlinkaddress(INDEX('Photo Tracking'!C:C,LOOKUP(2,1/SEARCH(B13,'Photo Tracking'!$K$1:$K$200),ROW('Photo Tracking'!K:K)))),"OK"),"NO"))


    Drag it down...

    Lookup() will always get the last matching (latest) value, but match/vlookup will targets on the first matching result.

    I restricted the lookup vector search range to $K$1:$K$200 for speeder processing...

    SEARCH(B13,'Photo Tracking'!$K$1:$K$200)

    Change the range $K$1:$K$200 to your actual data range if needed. But don't refer it to whole column which may result excel to crash also... Because of giving too much of load to Search() function to do the entire column range in a single cell processing.
    Last edited by :) Sixthsense :); 09-22-2014 at 12:38 AM.

  11. #11
    Registered User
    Join Date
    01-02-2014
    Location
    Santa Rosa, CA
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Macro to read another cells hyperlink address

    Sixthsense,

    Thank you for your assistance. That formula worked perfectly.

+ 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. [SOLVED] Lookup Hyperlink and go to Address with Macro
    By cfherd in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-11-2012, 04:24 AM
  2. Hyperlink points to address based on input from 2 cells
    By CKD777 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 10-15-2011, 04:18 PM
  3. Change email address to hyperlink w/Macro
    By dkub in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-26-2011, 12:20 PM
  4. Replies: 5
    Last Post: 06-22-2006, 07:10 AM
  5. Replies: 0
    Last Post: 03-26-2006, 07:10 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