Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Create a HYPERLINK with a macro?

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   Report Post  
Posted to microsoft.public.excel.programming
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/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Create a HYPERLINK with a macro?

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
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
Need to create an automatic hyperlink [email protected] Excel Discussion (Misc queries) 3 April 1st 10 03:39 PM
How do I create a macro to remove path from hyperlink "address"? Ale Excel Discussion (Misc queries) 7 March 31st 08 06:48 PM
Create a Hyperlink as part of a macro Nahraine New Users to Excel 1 March 7th 07 04:37 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
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 03:05 AM.

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"