+ Reply to Thread
Results 1 to 10 of 10

Thread: Hyperlink to Random Cell

  1. #1
    Registered User
    Join Date
    05-15-2009
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2007
    Posts
    8

    Thumbs up Hyperlink to Random Cell

    It's me again:

    I want 2 cells to display the following:

    1: A hyperlink to a random cell in a particular column

    2: A hyperlink to recalculate the spreadsheet (to generate another random hyperlink in the cell above, but obviously it need not be linked, literally to 'refresh').

    Now, I can't find anything about number 2, but for number 1 I tried the following:

    =HYPERLINK((ADDRESS(INT(RAND()*100),COLUMN(H:H))),"Random User")
    But it keeps coming up with can't open file - obviously it's trying to open an external file. I've tried with quote marks around different bits, for example "ADDRESS.....H))"

    Thanks once again for any help rendered guys.

    Lake54
    Last edited by lake54; 05-15-2009 at 03:10 PM. Reason: Thread Solved

  2. #2
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Hyperlink to Random Cell

    For number 1: Change formula to:

    =HYPERLINK(("#"&ADDRESS(INT(RAND()*100),COLUMN(H:H))),"Random User")

    Not sure exactly what you mean with #2
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    05-15-2009
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Hyperlink to Random Cell

    Thanks, that worked great!

    And I've just realised that Number two has now been made obsolete.

    I'll mark as solved now.

  4. #4
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,777

    Re: Hyperlink to Random Cell

    Sooner or later, int(rand()*100) will return zero, giving an invalid address.

    =HYPERLINK("#R" & INT(RAND()*100 + 1) & "C8", "Random User")
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Hyperlink to Random Cell

    Since RAND() is already volatile... you can still use ADDRESS() function can't you?

    =HYPERLINK(("#"&ADDRESS(INT(RAND()*100+1),COLUMN(H:H))),"Random User")
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  6. #6
    Registered User
    Join Date
    05-15-2009
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Hyperlink to Random Cell

    Sorry - only just noticed I had more replies!

    Both work for me, but I've chosen shg's method, and changed 100 to 10,000 (without the comma) because the values were quite small (there's always going to be around 200,000 rows, and someone needs to be able to go to a random row at any time).

    Thanks for your help once again :-)

  7. #7
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,777

    Re: Hyperlink to Random Cell

    Apparently I had R1C1 on the brain:

    =HYPERLINK("#H" & INT(RAND()*100) + 1, "Random User")
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  8. #8
    Registered User
    Join Date
    05-15-2009
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Hyperlink to Random Cell

    So should I be using the latest suggestion, shg?

  9. #9
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,777

    Re: Hyperlink to Random Cell

    Any of the many are fine. Pick one that tickles your fancy.
    Last edited by shg; 05-15-2009 at 04:27 PM.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  10. #10
    Registered User
    Join Date
    05-15-2009
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Hyperlink to Random Cell

    OK thanks - I've kept with the one I said earlier as I now have 2 formats of the same spreadsheet, all zipped up and emailed out now lol.

    I'm sure I'll be back in the future guys - this is really great for a forum!

+ 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.2.0