Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Jan 2004
    Location
    London, Middlesex, England
    Posts
    268
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Show hyperlinked cell Top Left

    Hello,

    I want to hyperlink to a cell in Excel but the cell should show on the top left of the screen (not the bottom of the screen).

    One way is to put a higher row number, but this places the cursor in that cell further down. I'd like to have the cursor in a cell & at the same time, have the cell top-left.

    Is that possible? TIA.

    BD.

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Show hyperlinked cell Top Left

    How it displays depends on where you start from. If your window has the cell of interest visible it will not reset the window, it will just goto the cell keeping the window as it is.

    To do what you ask requires a macro to get far enough below the row and far enough to the right that it will move the window just enough to put the cell in the upper left. The best way is to goto cell IV65536 and then goto the cell

    For example this macro will goto cell f10 and put it into the upper left cell:
    <pre>Sub GotoF10()
    Application.Goto Reference:=Range("IV65536")
    Application.Goto Reference:=Range("f10")
    End Sub</pre>


    Steve

  3. #3
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Show hyperlinked cell Top Left

    is it possible to have a hyperlink call (or invoke) a subroutine (macro)? I would like to list five items at the top of a worksheet and have the user click on any of the five items and be taken to the appropriate cell (named range, actually). I would want to go to IV65536 then back to the desired location in order to have it positioned at the top left of the screen.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Show hyperlinked cell Top Left

    If you enter the names of the ranges in A1:A5, you can use this code in the worksheet module. No hyperlinks needed.

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Select Case Target.Address
    Case "$A$1", "$A$2", "$A$3", "$A$4", "$A$5"
    Application.Goto Reference:=Range(Target), Scroll:=True
    End Select
    End Sub

  5. #5
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Show hyperlinked cell Top Left

    Okay, I understand the logic except... how would the code be invoked?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Show hyperlinked cell Top Left

    Right click the sheet tab.
    Select View Code from the popup menu.
    Copy the code from my reply into the module that appears.
    Modify the code as needed.

    The code is the so-called event procedure for the SelectionChange event of the worksheet. It will be run automatically when the user selects a different cell. The Target argument refers to the cell or cells selcted by the user.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •