![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Location: Netherlands
Posts: 3
|
Is there a way to start a macro by clicking on a hyperlink ?
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
|
There certainly is. Say you want a hyperlink in cell A1. In cell A1 click Insert, Hyperlink and press the Bookmark button. Then type A1 in the Cell Reference box. Click OK and OK again. Now right click the worksheet tab and choose View Code. Paste this:-
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) YourMacroName End Sub Where YourMacroName is probably stored in a standard module. HTH, Dan |
|
|
|
|
|
#3 |
|
New Member
Join Date: Feb 2002
Location: Netherlands
Posts: 3
|
Thank you, this works OK !!
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|