Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Running a Macro from a Hyperlink

Hi Shetty,

<<But this can be done only for some predefined cells. Can it be done for
any cell (not predefined)

If you wanted to do it for any cell on the worksheet, you could use On
Error Resume Next to blow by anything that wasn't a valid macro name. Not my
preferred way of programming, but it would work:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Application.Run Target.Value
End Sub

<<or without Worksheet_Change event ?

You could set the legacy Worksheet.OnEntry property to a macro that did
the same thing, but that isn't conceptually different from using the
Worksheet_Change event. There aren't any other ways that I can think of
right off the bat.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm


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
Intra-workbook hyperlink: macro/function to return to hyperlink ce marika1981 Excel Discussion (Misc queries) 3 May 6th 05 05:47 AM
Macro to Copy Hyperlink to another file as a HYPERLINK, not text... dollardoc Excel Programming 1 April 7th 05 12:47 AM
Running a macro from a hyperlink dmthomas Excel Programming 2 January 20th 04 10:19 AM
running a VBA sub from a hyperlink Paul James[_3_] Excel Programming 6 November 16th 03 01:51 PM
Launch Macro in Access via Macro running in Excel??? dgrant Excel Programming 1 September 24th 03 01:38 PM


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