ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hyperlink to execute macro. (https://www.excelbanter.com/excel-programming/290418-re-hyperlink-execute-macro.html)

Frank Kabel

Hyperlink to execute macro.
 
Hi
you can use the worksheet_followhyperlink event to achieve this. E.g.
put the following code in your worksheet module
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
If Target.Range.Address = "$A$1" Then
'insert your code here
End If
End Sub

The above will process your code if the hyperlink in cell A1 is
invoked.

HTH
Frank

Kevgrn114 wrote:
How do I make a hyperlink that will run a specified macro when
clicked?




KevGrn114

Hyperlink to execute macro.
 
I got it I got it

I was trying to put the code in the general Modules and not in the code on the specific sheet

Thank you for the help.

Frank Kabel

Hyperlink to execute macro.
 
kevgrn114 wrote:
I got it I got it!

I was trying to put the code in the general Modules and not in the
code on the specific sheet.

Thank you for the help.


Hi
good to hear
Frank


All times are GMT +1. The time now is 05:44 PM.

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