Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Nov 2003
    Location
    Virginia
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hyperlinks (Windows 2000)

    I have an excel spreadsheet that has 12 rows frozen at the top with hyperlinks to certain areas in my spreadsheet. When I click on the hyperlink the cursor will go to that cell, within the excel window, but it may be at the bottom right of my screen. What I want it to do is bring the active cell to the upper left corner of the screen. Is there a way to accomplish this?

  2. #2
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlinks (Windows 2000)

    Try:

    Sub MoveToTopLeft()
    ActiveWindow.ScrollColumn = ActiveCell.Column
    ActiveWindow.ScrollRow = ActiveCell.Row
    End Sub

  3. #3
    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: Hyperlinks (Windows 2000)

    If you use a macro instead of a hyperlink, you could use GOTO with the scroll parameter:

    <pre>Sub GotoCell()
    Application.Goto reference:=Range("P44"), _
    Scroll:=Trueend sub
    End Sub</pre>


    If you had a lot of them you could have them all called from FORMS "label" that was blank, and format the cell to look like the hyperlink and have the cell address inside the cell (this would look like a hyperlink and have the pointing finger cursor) and assign all of them the macro:

    <pre>Sub GotoCell2()
    Dim sRng As String
    sRng = ActiveSheet.Shapes(Application.Caller).TopLeftCell .Value
    Application.Goto reference:=Range(sRng), _
    Scroll:=True
    End Sub</pre>


    This macro would look at what shape called it, get the value of the cell that it was in and goto that cell.

    Steve

Posting Permissions

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