ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Hyperlink Help (https://www.excelbanter.com/excel-discussion-misc-queries/134318-hyperlink-help.html)

DariusCole

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.

joel

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.


joel

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.



All times are GMT +1. The time now is 10:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com