Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can I automate the launch of a macro using the result of a formula

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Can I automate the launch of a macro using the result of aformula

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
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Can I automate the launch of a macro using the result of a formula

Right click sheet tabview codepaste 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

"Charlie Betz" <Charlie
wrote in message
...
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
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
Macro Showing Formula and Result Simon Excel Programming 2 February 13th 06 08:22 AM
How can I replace a formula with its result using a macro? RAP Excel Programming 13 August 1st 05 06:22 AM
Macro launch - Button vs Manual launch , has different results. Wayne Excel Programming 4 February 23rd 05 11:33 AM
Launch Macro on Result of Validation Darin Kramer Excel Programming 11 December 20th 04 05:28 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 10:14 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"