+ Reply to Thread
Results 1 to 2 of 2

Hyperlink to replace existing page?

  1. #1
    Registered User
    Join Date
    09-14-2010
    Location
    High Wycombe, England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Hyperlink to replace existing page?

    Hi,

    I have an excel summary document that has hyperlinks to various other documents - is there a way to use these hyperlinks so that when you click the hyper link it doesn't open a new document in a new sheet, what I need is for the original summary sheet to be replaced by the document opened with the hyperlink.

    By doing this only one excel document will be open at any given time - I will then do a "return" link to go back to the summary sheet.

  2. #2
    Registered User
    Join Date
    09-14-2010
    Location
    High Wycombe, England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Hyperlink to replace existing page?

    I worked out how to do this in the end.

    1. Open the workbook, alt+F11 to open vba editor,
    2. On the left, doubleclick ThisWorkbook module under your workbook name on the vba project pane.
    3. Copy the following code and paste it on the right blank area
    Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As Hyperlink)
    ThisWorkbook.Saved = True
    ThisWorkbook.Close
    End Sub
    4. Save workbook, do the above steps on another workbook
    Note: the code above assume you don't need to save the workbook before closing even changes were made, if save before close is needed change this line
    ThisWorkbook.Saved = True
    to this line
    If ThisWorkbook.Saved = False Then ThisWorkbook.Save

+ 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