#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Hyperlink Help

I want to link 2 (or more....well okay, closer to 100!) excel workbooks
stored in different files using hyperlinks. Is there any macro or way that I
can click on the hyperlink, go to the new workbook, and close the old
workbook? I can hyperlink just fine, but it keeps opening up a new, seperate
excel sheet with each new workbook I open, and it clutters up my taskbar.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Hyperlink Help

If the Hyperlink is at cell C22. I would add a button for each Hyperlink
that would call a macro similar to the one below.

Sub HperlinkandClose()
'
' Macro3 Macro
' Macro recorded 3/10/2007 by jwarburg
'

'
Set oldworkbook = ThisWorkbook

Range("C22").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True

oldworkbook.Close SaveChanges:=True
End Sub

"DariusCole" wrote:

I want to link 2 (or more....well okay, closer to 100!) excel workbooks
stored in different files using hyperlinks. Is there any macro or way that I
can click on the hyperlink, go to the new workbook, and close the old
workbook? I can hyperlink just fine, but it keeps opening up a new, seperate
excel sheet with each new workbook I open, and it clutters up my taskbar.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Hyperlink Help

I found a better way of closing the file. Put this code into the old
workbook in the
VBA Thsiworkbook module. You can make savechanges either true or false

Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, _
ByVal Target As Hyperlink)

ThisWorkbook.Close savechanges:=True

End Sub

"DariusCole" wrote:

I want to link 2 (or more....well okay, closer to 100!) excel workbooks
stored in different files using hyperlinks. Is there any macro or way that I
can click on the hyperlink, go to the new workbook, and close the old
workbook? I can hyperlink just fine, but it keeps opening up a new, seperate
excel sheet with each new workbook I open, and it clutters up my taskbar.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't make hyperlink function work for hyperlink to website Frank B Denman Excel Worksheet Functions 15 February 5th 07 11:01 PM
How do I create a hyperlink to a cell with the hyperlink function S. Bevins Excel Worksheet Functions 2 July 20th 06 08:06 PM
Moving rows with Hyperlink doesn't move hyperlink address Samad Excel Discussion (Misc queries) 15 June 22nd 06 12:03 PM
Hyperlink from one sheet to the hyperlink on another AO Excel Discussion (Misc queries) 2 July 5th 05 11:27 AM
Intra-workbook hyperlink: macro/function to return to hyperlink ce marika1981 Excel Discussion (Misc queries) 3 May 6th 05 05:47 AM


All times are GMT +1. The time now is 02:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"