LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Run a macro from within a function

Hi,

Yes you probably can but no you can't simply call a macro with an if
statement. Some cell must change to make C3 switch between "Yes" & "no". so
you can use the worksheet change event to fire your macro.

Right click your sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("C3").Value < "Yes" Then Exit Sub
'do things
End Sub

Mike

"BK523" wrote:

I would like to launch a macro from within an "IF" statement.
Example: Cell C3 is a "yes / no" type cell. Cell C4 would evaluate the
contents of C3 and launch a macro if C3="Yes"

Can this be done?

 
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 with sum function RobRem Excel Worksheet Functions 1 April 25th 09 03:24 AM
Using macro or other function orquidea Excel Discussion (Misc queries) 2 December 5th 07 05:37 PM
Sub Macro vrs Function Macro Auto Start Pat Excel Discussion (Misc queries) 7 June 6th 07 09:53 PM
macro or function BAZZA Excel Worksheet Functions 2 September 18th 05 02:44 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM


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