+ Reply to Thread
Results 1 to 9 of 9

Hyperlinking from an array

  1. #1
    Forum Contributor
    Join Date
    02-20-2017
    Location
    Indiana
    MS-Off Ver
    2016
    Posts
    101

    Hyperlinking from an array

    Hello,

    I'm in the process of making a calendar that looks up what reports my business does on a weekly basis and provides hyperlinks to the standard work for each report from an array. I've gotten the formulas to return which reports we do and the correct hyperlink shows up when I hover over the cell, but the cell isn't colored blue like regular hyperlinks and also when I click on it, it returns a message "Cannot open the specified file." The file does open when I open it from the array though. Let me know if you know what the problem is. Here is the formula.


    {=IF(ISERROR(INDEX(Calandar!$C$2:$I$45,SMALL(IF(Calandar!$E$6:$E$45="x",ROW(Calandar!$E$6:$E$45)),ROW(1:1))-1,1)),"",HYPERLINK(INDEX(Calandar!$C$2:$I$45,SMALL(IF(Calandar!$E$6:$E$45="x",ROW(Calandar!$E$6:$E$45)),ROW(1:1))-1,2),INDEX(Calandar!$C$2:$I$45,SMALL(IF(Calandar!$E$6:$E$45="x",ROW(Calandar!$E$6:$E$45)),ROW(1:1))-1,1)))}

  2. #2
    Forum Contributor
    Join Date
    02-20-2017
    Location
    Indiana
    MS-Off Ver
    2016
    Posts
    101

    Re: Hyperlinking from an array

    I condensed the formula to only look at the hyperlink itself.

    {=HYPERLINK(INDEX(Calandar!$C$2:$I$45,SMALL(IF(Calandar!$E$6:$E$45="x",ROW(Calandar!$E$6:$E$45)),ROW(1:1))-1,2),INDEX(Calandar!$C$2:$I$45,SMALL(IF(Calandar!$E$6:$E$45="x",ROW(Calandar!$E$6:$E$45)),ROW(1:1))-1,1)))}

    Now the hyperlink it returns is blue like a regular hyperlink, but I'm still getting the same message when I try to open the hyperlink. "Cannot open the specified file." I'm starting to think that hyperlinks don't work well with the array command (Ctrl+shift+enter)

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Hyperlinking from an array

    INDEX will return the contents of a cell, but that is probably not a reference, just a value?

    H/L needs a reference to go to, something like this...
    =IFERROR(HYPERLINK("#"&"'"&INDEX(Sheetnames,ROWS($A$2:A2))&"'!A1",INDEX(Sheetnames,ROWS($A$2:A2))),"")
    In this case, INDEX is returning a sheet name, which is then being combined with '!A1 to produce the link

    "#"&..... tells excel to link to a sheet, not a file
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Hyperlinking from an array

    Hyperlink formula works with array.

    What is the string returned from Index() part of your formula (i.e. without hyperlink)?

    Does is have full path? (Ex. C:\Test\Test.xlsb) If not you need full path, not just file name.

  5. #5
    Forum Contributor
    Join Date
    02-20-2017
    Location
    Indiana
    MS-Off Ver
    2016
    Posts
    101

    Re: Hyperlinking from an array

    Quote Originally Posted by CK76 View Post
    Hyperlink formula works with array.

    What is the string returned from Index() part of your formula (i.e. without hyperlink)?

    Does is have full path? (Ex. C:\Test\Test.xlsb) If not you need full path, not just file name.
    {=IF(ISERROR(INDEX(Calandar!$C$2:$I$45,SMALL(IF(Calandar!$E$6:$E$45="x",ROW(Calandar!$E$6:$E$45)),ROW(1:1))-1,1)),"",HYPERLINK(INDEX(Calandar!$C$2:$I$45,SMALL(IF(Calandar!$E$6:$E$45="x",ROW(Calandar!$E$6:$E$45)),ROW(1:1))-1,2),INDEX(Calandar!$C$2:$I$45,SMALL(IF(Calandar!$E$6:$E$45="x",ROW(Calandar!$E$6:$E$45)),ROW(1:1))-1,1)))}

    Not sure which index you're talking about so I will explain all three. The first index just checks to see if there isn't an "x" in that days column. If true, cell returns blank (""). If false, the second index function looks for the hyperlink from the array (in column 2 of array) Last index looks for name of the hyperlink in the array (in column 1 of array)

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Hyperlinking from an array

    The one inside Hyperlink As that's what's used to build link.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Hyperlinking from an array

    Did you read post #3?

  8. #8
    Forum Contributor
    Join Date
    02-20-2017
    Location
    Indiana
    MS-Off Ver
    2016
    Posts
    101

    Re: Hyperlinking from an array

    Quote Originally Posted by FDibbins View Post
    Did you read post #3?

    Yes, I tried to implement that, but was unsuccessful. However I did just figure out what was wrong. Nothing was wrong with the formula itself, it was the file pathway that I screwed up on. *facepalm* I forgot to add .docx to the end of the pathway. The hyperlinks work now.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Hyperlinking from an array

    Quote Originally Posted by BryceVBA View Post
    Yes, I tried to implement that, but was unsuccessful.
    Well a reply to that affect would have been helpful - as well as explaining what "unsuccessful" meant

+ 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. Hyperlinking
    By Lost123 in forum Excel General
    Replies: 4
    Last Post: 04-06-2010, 03:19 PM
  2. Hyperlinking
    By shane r in forum Excel General
    Replies: 4
    Last Post: 01-15-2009, 10:04 AM
  3. Hyperlinking
    By MAQurashi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-31-2008, 05:14 PM
  4. Excel 2007 : Help with hyperlinking
    By lindty72 in forum Excel General
    Replies: 1
    Last Post: 10-28-2008, 02:58 PM
  5. Hyperlinking
    By sparx in forum Excel General
    Replies: 1
    Last Post: 06-27-2007, 08:23 PM
  6. Hyperlinking
    By RickM in forum Excel General
    Replies: 2
    Last Post: 10-15-2006, 02:18 PM
  7. Hyperlinking
    By Niccalo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-31-2005, 07:07 AM
  8. Hyperlinking to JPG
    By annodo in forum Excel General
    Replies: 3
    Last Post: 01-19-2005, 10:26 AM

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