+ Reply to Thread
Results 1 to 6 of 6

Centering on a Hyperlinked cell

Hybrid View

  1. #1
    Registered User
    Join Date
    07-25-2008
    Location
    Asheville, NC
    Posts
    16

    Centering on a Hyperlinked cell

    Hello fellow excel junkies,
    I have the following formula in H4 in sheet 1:

    =IF(COUNTIF(sheet2!$C$2:$C$300,$C2)>0,HYPERLINK("#sheet2!"&ADDRESS(MATCH($C2,sheet2!$C:$C,0),3),"Click Here"),"")

    As you can see, H4 in sheet 1 will search column c in sheet2 for the value of cell C2 in sheet 1. I have the hyperlink working correctly in H4, so if it finds a match it will say "click here" and will take you to sheet 2 and highlight the matching cell in column C. however, it will not center on the cell, sometimes not even coming close.

    Is there a way to use the hyperlink function that I have here, and just change/add to it so that it will center on the matching cell when I hit the "click here" text?

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    A sample I did myself using your formula worked as expected highlighting the first occurance of a match to C2 in Sheet2!C:C.

    It would be better if you supplied your own sample spreadsheet and tell us when it doesn't work as expected.
    Where there is a will there are many ways.

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

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

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    http://www.excelforum.com/showthread.php?t=634418
    is a post i did some time ago it has code for centering when jumping via hyperlink
    it should be able to be automted on click or similar

  4. #4
    Registered User
    Join Date
    07-25-2008
    Location
    Asheville, NC
    Posts
    16

    Any Suggestions

    Quote Originally Posted by martindwilson
    http://www.excelforum.com/showthread.php?t=634418
    is a post i did some time ago it has code for centering when jumping via hyperlink
    it should be able to be automted on click or similar
    Thanks for the code, do you have any suggestions for applying this code to a specific hyperlinked cell. I hate to complicate things (plus this may sound wierd) but my original example was only a freaction of my hyperlink formulas. I actually have 12 different cells that each search a different sheet in my workbook for a match with C2 on sheet 1, so H4 searches in sheet 2, I4 searches sheet 3, J4 searches sheet 4 and so on.

    Is there a way to apply your VB code to all 12 cells?

  5. #5
    Registered User
    Join Date
    07-25-2008
    Location
    Asheville, NC
    Posts
    16

    No Problems matching, just on centering

    Quote Originally Posted by NBVC
    A sample I did myself using your formula worked as expected highlighting the first occurance of a match to C2 in Sheet2!C:C.

    It would be better if you supplied your own sample spreadsheet and tell us when it doesn't work as expected.
    Its not that the function doesn't work, it will find a match without any problems. My issue is that i would like the screen to center on the matched cell. Depending on a number of factors, once I hyperlink the matched cell may be at the very top or bottom of the screen. Sometimes it is pretty close to centered, but I want it to be consistant.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by rs56369
    Its not that the function doesn't work, it will find a match without any problems. My issue is that i would like the screen to center on the matched cell. Depending on a number of factors, once I hyperlink the matched cell may be at the very top or bottom of the screen. Sometimes it is pretty close to centered, but I want it to be consistant.
    Oh, I see. I misinterpreted your question I think... see Martin's suggestion above.

+ 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