Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can anyone tell me how to create a hyperlink to a different sheet with a
macro? The sheet will always be the third tab when the macro runs but may change locate subsequently so the hyperlink must refer to the sheet name. I appreciate your help. --- Message posted from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This formula should do what you want.
=HYPERLINK("[Yourworksheet.xls]yourworksheet!a1") But, I prefer to use a double click event macro to do this right click sheet tabview codeinsert this Then just double click on the cell with a typed name of the sheet desired. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim mysheet As String mysheet = Trim(ActiveCell.Value) On Error GoTo no Sheets(mysheet).Select Exit Sub no: MsgBox "No Sheet" End Sub -- Don Guillett SalesAid Software "bobgerman" wrote in message ... Can anyone tell me how to create a hyperlink to a different sheet with a macro? The sheet will always be the third tab when the macro runs but may change locate subsequently so the hyperlink must refer to the sheet name. I appreciate your help. --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sheets("Index").Select
Range("A5").Select Dim mycel As String mycel = (ActiveCell.Value) ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _ mycel & "!A1:B1" Using info originally obtained from Don...Thanks Don! --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need to create an automatic hyperlink | Excel Discussion (Misc queries) | |||
How do I create a macro to remove path from hyperlink "address"? | Excel Discussion (Misc queries) | |||
Create a Hyperlink as part of a macro | New Users to Excel | |||
How do I create a hyperlink to a cell with the hyperlink function | Excel Worksheet Functions | |||
Intra-workbook hyperlink: macro/function to return to hyperlink ce | Excel Discussion (Misc queries) |