Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Worksheet with multiple Hyperlinks and Macros

Good Day All,

I need help with preparing a macro for each hyperlink in my worksheet. I
have an org chart that I created hyperlinks for each department. I have
approximately 40 departments. I want to be able to click on the hyperlink
that will run a macro. I want the macro to populate a fixed cell in the
worksheet with the department name I assign to the hyperlink. My dilemma now
is that I do not know how to distinguish a macro for each hyperlink. I am
using the following code I copied from a previous message:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
If Not Intersect(Target.Parent, Range("B5")) Is Nothing Then
ActiveSheet.PageSetup.CenterHeader = "&""Arial,Bold""2006 Expense
Variance Report for Sales"
Worksheets("Expense Report").Select
Range("AA5").Select
ActiveCell.FormulaR1C1 = "Sales"
Calculate
Worksheets("Expense Report").Select
Range("K3").Select
End If
End Sub

AA5 is the fix cell I want to populate with the department name each time I
click on a hyperlink. Each hyperlink will have a different PageHeader and
ActiveCell FormulaR1C1.

Thank you very much.
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
hyperlinks and macros Randy[_4_] Excel Discussion (Misc queries) 0 February 2nd 09 07:09 PM
Hyperlinks & macros Mick Links and Linking in Excel 1 January 19th 09 04:57 PM
Hyperlinks & macros Mick Excel Discussion (Misc queries) 0 January 18th 09 08:07 PM
change multiple hyperlinks in worksheet Pieman Links and Linking in Excel 0 February 5th 07 01:52 PM
Using Multiple Tests and Sounds With Worksheet Macros Carl Excel Discussion (Misc queries) 3 July 1st 06 07:35 PM


All times are GMT +1. The time now is 01:47 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"