Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Execute Macros through Hyperlinks.

could anybody help my in this regard? I need to execute Macros by using
simple text links (hyperlinks). I can run macros through images or form
objects, but now the problem is bit different. I dont even have an idea
how to run macros through hyperlinks. please guys help me out in this
regard, it is very urgent for me. thanks and regards,

Saddat Sarfraz
(Saadi)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Execute Macros through Hyperlinks.

Create hyperlinks which just point to the same cell the hyperlink is in.
Handle the sheet's FollowHyperlink event to dtermine which link was clicked.

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

Select Case Target.Address 'or some other property
Case "D8": MsgBox "call a macro"
Case "D9": MsgBox "call a different macro"
End Select

End Sub

....replace the Msgbox with calls to the appropriate macro.

Tim


--
Tim Williams
Palo Alto, CA


wrote in message
oups.com...
could anybody help my in this regard? I need to execute Macros by using
simple text links (hyperlinks). I can run macros through images or form
objects, but now the problem is bit different. I dont even have an idea
how to run macros through hyperlinks. please guys help me out in this
regard, it is very urgent for me. thanks and regards,

Saddat Sarfraz
(Saadi)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Execute Macros through Hyperlinks.

thanks Tim for your reply,

could you also help me out and tell me how do I call the Macro. may I
just need to wrtie the name of the macro in place of MsgBox function.

thanks,

Saddat Sarfraz
(Saadi)

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Execute Macros through Hyperlinks.

may I just need to wrtie the name of the macro in place of MsgBox function.
Yes - that's all you need to do
....
Case "whatever": MacroName
....

Tim
--
Tim Williams
Palo Alto, CA


wrote in message
ups.com...
thanks Tim for your reply,

could you also help me out and tell me how do I call the Macro.
thanks,

Saddat Sarfraz
(Saadi)



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Execute Macros through Hyperlinks.

Sorry to trouble you again.

I am trying to run the command but nothing is happaning. I tried with
Macro as well as MsgBox Function, nothing is working.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Execute Macros through Hyperlinks.

Show the exact code which is not working.
What does it do instead of working?

tim

--
Tim Williams
Palo Alto, CA


wrote in message
oups.com...
Sorry to trouble you again.

I am trying to run the command but nothing is happaning. I tried with
Macro as well as MsgBox Function, nothing is working.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Execute Macros through Hyperlinks.

Hi,
This worked:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

Select Case ActiveCell.Address

Case "$D$8": MyMacro
Case "$D$9": MsgBox "call a different macro"

End Select

End Sub

Sub MyMacro()
MsgBox "MyMacro called"
End Sub


HTH

" wrote:

Sorry to trouble you again.

I am trying to run the command but nothing is happaning. I tried with
Macro as well as MsgBox Function, nothing is working.


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
Execute Multiple Hyperlinks in Excel Biocellguy Excel Worksheet Functions 0 January 8th 09 08:41 PM
How to execute Macros through Text Links? Sheikh Saadi Excel Discussion (Misc queries) 0 January 17th 06 07:02 PM
How to execute macros not saved in a workbook David P.[_3_] Excel Programming 0 April 1st 04 02:51 AM
Execute macros under Excel and Oulook XP POV Samnang Excel Programming 1 September 10th 03 06:40 AM
Execute macros under Excel and Oulook XP Dick Kusleika Excel Programming 0 September 4th 03 06:49 PM


All times are GMT +1. The time now is 06:04 PM.

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"