+ Reply to Thread
Results 1 to 8 of 8

scroll linked cell to upper left position

  1. #1
    Registered User
    Join Date
    10-09-2011
    Location
    La Grange, KY USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    scroll linked cell to upper left position

    In sheet 1, I link to a cell in sheet 2. I want the linked cell in sheet 2 to scroll to upper left of sheet 2. I need to do this from different links in worksheet 1 to different cells in sheet 2.

    Suggestions or solutions?

    Thanks,
    George

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: scroll linked cell to upper left position

    Try pasting this code into the Sheet2 tab in the VBA editor (Alt F11).

    Please Login or Register  to view this content.
    Martin

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: scroll linked cell to upper left position

    I'd prefer:

    Please Login or Register  to view this content.
    In the codemodule of sheet1
    Last edited by snb; 10-09-2011 at 05:44 PM.



  4. #4
    Registered User
    Join Date
    10-09-2011
    Location
    La Grange, KY USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: scroll linked cell to upper left position

    Quote Originally Posted by snb View Post
    I'd prefer:

    Please Login or Register  to view this content.
    In the codemodule of sheet1
    I tried this code in both code modules of the Workbook and Sheet1 but it doesn't work. I've also tried creating a module and putting it in there but no luck. I'm trying anything at this point. I've tried several other pieces of code with no luck. I'm probably putting it in the wrong place. If that's the case, can someone tell show me where it goes. I even downloaded a spreadsheet that has this code init and it worked at first but then stopped working. I have no idea why?

    I've attached a sample spreadsheet of what I'm trying to do.

    Please help!

    Thanks,
    George
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-09-2011
    Location
    La Grange, KY USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: scroll linked cell to upper left position

    Quote Originally Posted by mrice View Post
    Try pasting this code into the Sheet2 tab in the VBA editor (Alt F11).

    Please Login or Register  to view this content.
    I tried this code in sheet2 but I got a compile error for undefined variable "MyRow."

    I'm not having a good day.

    George

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: scroll linked cell to upper left position

    The code has to be put into the macromodule of the sheet that contains the hyperlink.

    See the attachment.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-09-2011
    Location
    La Grange, KY USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: scroll linked cell to upper left position

    Quote Originally Posted by snb View Post
    The code has to be put into the macromodule of the sheet that contains the hyperlink.

    See the attachment.
    HI SNB,

    Your example works perfectly and does exactly what I need. However, I copied your code into a new blank workbook and it worked. I'm using Excel 2007.

    When I tried to save it, Excel wants to save it as an .xlsm (macro enabled) because of VB Project. After I save it as this, it stops working. I then saved it as .xlsx but it didn't work either. I saved it as .xls and it didn't work.

    Is there something wrong in my copy of Excel or do I have something selected that causes it to misfire?

    George

  8. #8
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: scroll linked cell to upper left position

    Please do not quote (see the forum rules).

    Nothing wrong with your copy of Excel.
    I'd say: dive into the code, try to understand it, dive into the VBeditor, use every debugging tool possible and merge into the vbeditor's helpfiles. It'll make you more independent of this forum.

+ 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