Results 1 to 10 of 10

When executing macro via hyperlink, macro doesn't re-scroll window back to A1

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-29-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    471

    When executing macro via hyperlink, macro doesn't re-scroll window back to A1

    Hi guys. I need slight help with one of my macros. I'm using following code on sheet called "analyse" to execute macro via hyperlink
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    If Target.Address = "$E$7" Then
        Application.Run "hyperlink_backlog_monday"
    End If
    End Sub
    This code is placed within the correct module of course (under analyze)


    Now when clicking E7 on sheet "analyze" it triggers macro "hyperlink_backlog_monday" which essentially copies information from one sheet to another, filters in some unwanted rows and deletes them. As a part of the code in "hyperlink_backlog_monday" I have following line
    Application.Goto Reference:=Range("a1"), Scroll:=True
    This line simply scrolls window back to A1. Its a good feature to have. Otherwise when I go back and forth between the sheets and re run some macros, it then remembers the last window placement. This causes me to scroll back to A1 manually with a mouse. This gets annoying really fast.

    Anyway, when I execute"hyperlink_backlog_monday" in normal way it performs all actions beautifully and line Application.Goto Reference:=Range("a1"), Scroll:=True does its job.
    But as soon as macro "hyperlink_backlog_monday" is executed via clicking E7 on sheet "analyze" it performs everything within the macro except this scrolling part. After the macro run, the window scroll bars are where the were last time when used.

    Can anyone help me to tackle this problem. I would be very grateful.


    Cheers
    Rain

    EDIT: See attached xls on post 3
    Last edited by rain4u; 05-15-2011 at 02:31 PM.

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