Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Adding a Macro to a Hyperlink

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
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?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Adding a Macro to a Hyperlink

Thank you very much worked like a charm.
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
Adding a Hyperlink Richard Excel Discussion (Misc queries) 0 September 5th 06 07:52 PM
exel hyperlink moves when adding new row or column swef Excel Discussion (Misc queries) 1 February 17th 06 05:46 PM
disabling the underline when adding a hyperlink [email protected] Excel Discussion (Misc queries) 2 November 21st 05 04:44 PM
Adding Hyperlink to Pivot Table data [email protected] Excel Worksheet Functions 0 October 21st 05 09:52 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 05:17 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"