PC Review


Reply
Thread Tools Rate Thread

Can I automate the launch of a macro using the result of a formula

 
 
Charlie Betz
Guest
Posts: n/a
 
      1st May 2008
I have developed a game in Excel. Successful completion causes a formula to
return 'True'. I want this result to launch a macro. As background the macro
will transport the player to another sheet.

Any advice will be very much appreciated
 
Reply With Quote
 
 
 
 
paul.robinson@it-tallaght.ie
Guest
Posts: n/a
 
      1st May 2008
Hi
Use the worksheet_change event

Private Sub Worksheet_Change(ByVal Target As Range)
Set MyCell = Range("A1") 'your formula in A1
If not intersect (Target, MyCell) is nothing then 'ignore unless
MyCell changes
If MyCell.Value = 2 then 'value from formula
call myMacro
End if
End if

End Sub

You find this event when you double click the sheet name in the visual
basic editor and choose Worksheet from the dropdown.
regards
Paul

On May 1, 11:30*am, Charlie Betz <Charlie
B...@discussions.microsoft.com> wrote:
> I have developed a *game in Excel. Successful completion causes a formula to
> return 'True'. I want this result to launch a macro. As background the macro
> will transport the player to another sheet.
>
> Any advice will be very much appreciated


 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      1st May 2008
Right click sheet tab>view code>paste this. Now if you change cell e1 to 2
you goto sheet 9

Private Sub Worksheet_Change(ByVal Target As Range)
'correct word wrap if necessary
If Target.Address = "$E$1" And Target = 2 Then Sheets("sheet9").Select

End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Charlie Betz" <Charlie (E-Mail Removed)> wrote in message
newsFBA31B7-CA37-4B11-9E4B-(E-Mail Removed)...
>I have developed a game in Excel. Successful completion causes a formula
>to
> return 'True'. I want this result to launch a macro. As background the
> macro
> will transport the player to another sheet.
>
> Any advice will be very much appreciated


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use VBA macro to populate formula result in 'next blank cell' =?Utf-8?B?TG9ucHV6?= Microsoft Excel Programming 4 10th Nov 2007 01:36 PM
Macro Showing Formula and Result =?Utf-8?B?U2ltb24=?= Microsoft Excel Programming 2 13th Feb 2006 08:22 AM
How can I replace a formula with its result using a macro? =?Utf-8?B?UkFQ?= Microsoft Excel Programming 13 1st Aug 2005 06:22 AM
Launch Macro on Result of Validation Darin Kramer Microsoft Excel Programming 11 20th Dec 2004 05:28 PM
launch macro from a formula arron Microsoft Excel Worksheet Functions 1 14th Nov 2003 05:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:56 PM.