Eliminate the window movement when using =HYPERLINK() in Excel


This is driving me nuts!!

It seems that anytime the =HYPERLINK() function in Excel (2007) has been used to create a link to a different workbook, clicking the link not only activates the target workbook but also moves it into exactly the same location on the screen already occupied by the workbook containing the link.  This appears to be the case regardless of whether the two workbooks are opened in a single Excel instance or opened in separate instances.  

The net result of course is that any advantage gained by positioning workbooks side-by-side to view them together is lost.  In other words, any desired benefit of using hyperlinks to jump quickly and easily between two workbooks, is lost since the target workbook does not remain fixed in its original position.

I suppose there are some occasions when one would want the target to move to the same location and essentially replace the initial worksheet (the one containing the link) but it seems MS would think to make that optional rather than the way it behaves in all cases.

Any suggestions on how to eliminate the window movement when using =HYPERLINK() would be very greatly appreciated!

Who is Participating?

Improve company productivity with a Business Account.Sign Up

dlmilleConnect With a Mentor Commented:
Steve - I see the issue.  I had two worksheets ARRANGED TILED and created a simple link between the two - and it put the one on top of the other.

One potential work-around, is to have code like this:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
application.displayalerts = false
    Windows.Arrange ArrangeStyle:=xlTiled
application.displayalerts = true
End Sub

in your worksheet that has the hyperlinks.

After pulling up the workbook that the worksheet hyperlinks to, the autoarrange ensures my workbooks are side-by-side.

the arrangement of windows (if specified ahead of time) can be managed with similar code.  This was just an example that ensures the worksheets I'm working with are arranged tiled.

Are you interested in going down this path?  with some effort, it may be possible to identify where all open workbooks exist, and on the hyperlink event, ensure they revert to where they were to start with...

Jignesh TharSenior ManagerCommented:
Steve_Brady - I didnt know about this behavior and I see that it works exactly as you described (irrespective of same or separate instance of excel). I dont believe there would be way to change this behaviour.

You might already know that there is something called Back button that you can add in "Customize Quick Access Toolbar" so that Back button (same as in internet explorer) appears when you navigate to different place using Hyperlink. Only advantage of this is an ability to return to cell from which you clicked Hyperlink. I know that this is not what you looking for (comparing worksheets side by side).
Steve: This is something from the Excel help file. I am not sure if this helps but thought that I'd mention it.

Excel Help
To select a cell that has a hyperlink in it without jumping to the hyperlink destination, click the cell and hold the mouse button until the cursor becomes a cross , then release the mouse button.

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Here is a snapshot.

wellousConnect With a Mentor Commented:

Here is a workaround of the issue,
Don't use Hyberlink but use Macro direct to open the workbook you want.
Create a module and paste this code into it, then save ,
the Marco will work when you press CTrl+r
Hope it helps,

Sub Macro1()
' Macro1 Macro
' Macro recorded 22/3/2011 by JZRS1446
' Keyboard Shortcut: Ctrl+r
  Workbooks.Open Filename:="E:\JZRS1446\Data\Science.xls"
' change E:/xxxxxx to the location of the file you want to open.
End Sub

I think it will not work if you take it copy/paste from here ..
Please follow this steps:

/ /Download the file i attached now.
/ /save on your PC .
/ /Open your (primary)Excel file which had hyberlinks.
/ /Press Alt+F11 ( to open VB editior)
/ /Go to File then Improt the my file to your excelsheet.
/ /Modify this code : Workbooks.Open Filename:="E:\JZRS1446\Data\Science.xls"
and write the location and file name you want to open.
/ /save , then goto excel workbook and press Ctrl+r
This way it will never put one sheet on top of the other in case of two worksheets are opened together..
Hope you like it :)
Steve_BradyAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.