View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default Create a HYPERLINK with a macro?

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/