View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Edwin Tam[_2_] Edwin Tam[_2_] is offline
external usenet poster
 
Posts: 8
Default Can you use an IF statement to launch a macro?

Sure. You can. Let's create the following two simple macros. One is custom worksheet function, the second on the a subroutine which pops up a msgbox

Function testing(
hello_macr
End Functio

Sub hello_macro(
MsgBox "hello
End Su

In cell B1, you type the following formula
=IF(A1="ABC",testing(),""

Change cell A1 to see the effect


----- ian123 wrote: ----

Is it possible to use an IF statement in cell b1 to launch a desire
macro if a1 equals the value specified in the IF statement

ie say IF a1 = "ABC" then the IF statement in b1 would recognise thi
and launch macro1

Does anyone know if this is possible or impossible? It would b
fantastic to learn that its possible!!


--
Message posted from http://www.ExcelForum.com