View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Adding a Macro to a Hyperlink

Right-click on the sheet tab and "View Code".

Select "worksheet" from the General dialog.

Some sheet_selection lines will drop down.

Ignore those and click on Declarations dialog box.

Select FollowHyperlink and add print command like so.

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Selection.PrintOut
End Sub


Gord Dibben MS Excel MVP

On Thu, 18 Sep 2008 07:15:01 -0700, Zee
wrote:

I would like to know if there is a way to add a macro to a hyperlink. Right
now the hyperlink is tied to a named range and what I want to do is have the
selected named range printed once the hyperlink is clicked. Is this possible?