Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default run sub from hyperlink

Is there a way to run a sub routine from a hyperlink in an excell cell?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default run sub from hyperlink

Have you considered the Worksheet_FollowHyperlink event?
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



" wrote:

Is there a way to run a sub routine from a hyperlink in an excell cell?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default run sub from hyperlink

Include the following event macro in the worksheet code area:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
MsgBox ("Hello world")
End Sub
--
Gary''s Student - gsnu2007k


" wrote:

Is there a way to run a sub routine from a hyperlink in an excell cell?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default run sub from hyperlink

On Dec 18, 1:49*pm, Gary''s Student
wrote:
Include the following event macro in the worksheet code area:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
MsgBox ("Hello world")
End Sub
--
Gary''s Student - gsnu2007k



" wrote:
Is there a way to run a sub routine from a hyperlink in an excell cell?- Hide quoted text -


- Show quoted text -


That is helpful but how can I have more than one per sheet each
triggering an different sub routine?
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default run sub from hyperlink

On Dec 18, 1:49*pm, Gary''s Student
wrote:
Include the following event macro in the worksheet code area:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
MsgBox ("Hello world")
End Sub
--
Gary''s Student - gsnu2007k



" wrote:
Is there a way to run a sub routine from a hyperlink in an excell cell?- Hide quoted text -


- Show quoted text -


that is helpful but how can I have more than one per page each
triggering an different sub? Or how can I tell which which hyperlink
triggered it so I can do a select case or something.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default run sub from hyperlink

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
MsgBox (Target.Parent.Address & Chr(10) & ActiveCell.Address)
End Sub

Try this. You will see that you have:
1. the cell that was clicked on
2. the destination address
--
Gary''s Student - gsnu200821


"mg" wrote:

On Dec 18, 1:49 pm, Gary''s Student
wrote:
Include the following event macro in the worksheet code area:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
MsgBox ("Hello world")
End Sub
--
Gary''s Student - gsnu2007k



" wrote:
Is there a way to run a sub routine from a hyperlink in an excell cell?- Hide quoted text -


- Show quoted text -


that is helpful but how can I have more than one per page each
triggering an different sub? Or how can I tell which which hyperlink
triggered it so I can do a select case or something.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default run sub from hyperlink

In fact, you can put the name of the desired macro in the ScreenTip and run
it as follows:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Dim s As String
s = Target.ScreenTip
Application.Run s
End Sub


--
Gary''s Student - gsnu200821


"mg" wrote:

On Dec 18, 1:49 pm, Gary''s Student
wrote:
Include the following event macro in the worksheet code area:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
MsgBox ("Hello world")
End Sub
--
Gary''s Student - gsnu2007k



" wrote:
Is there a way to run a sub routine from a hyperlink in an excell cell?- Hide quoted text -


- Show quoted text -


that is helpful but how can I have more than one per page each
triggering an different sub? Or how can I tell which which hyperlink
triggered it so I can do a select case or something.

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
Moving rows with Hyperlink doesn't move hyperlink address Samad Excel Discussion (Misc queries) 15 June 22nd 06 12:03 PM
Intra-workbook hyperlink: macro/function to return to hyperlink ce marika1981 Excel Discussion (Misc queries) 3 May 6th 05 05:47 AM
Macro to Copy Hyperlink to another file as a HYPERLINK, not text... dollardoc Excel Programming 1 April 7th 05 12:47 AM
reading html when hyperlink address not hyperlink text diplayed Kevin Excel Programming 1 December 4th 03 10:13 PM


All times are GMT +1. The time now is 11:15 PM.

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

About Us

"It's about Microsoft Excel"