View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_4_] Jim Thomlinson[_4_] is offline
external usenet poster
 
Posts: 1,119
Default can you make an IF command run a macro???

Just a guess but that probably wil not work based on your description that
U18 = 2. If U 18 is a formula then the on change code needs to catch changes
to the cells that are the precidents of the formula in U18. For exampl if U18
is the sum of S18 and T 18 then you need to catch changes to S18 or T18 and
then evaluate the value of U18. It is a bit more effort but it should work...
--
HTH...

Jim Thomlinson


"JMB" wrote:

you could use worksheet event code. right click on your worksheet, select
view code, and paste following into the code window that appears.

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("U18").Value = 2 Then Call macro1
End Sub

where macro1 is the name of your macro. or, you can incorporate your macro
code into this worksheet event handler instead of calling the macro.




"bigtonyicu" wrote:


Hey guys,

I need to get a macro (macro name is Superscript) to run automaticly if
the total of cell U18 = 2

Can I do it with an if command expample:
=if(U18=2, "???", " ")

??? = run superscript

or

I"m a newb at VB... could someone supply me with a VB script to do
this.


--
bigtonyicu
------------------------------------------------------------------------
bigtonyicu's Profile: http://www.excelforum.com/member.php...o&userid=22430
View this thread: http://www.excelforum.com/showthread...hreadid=478242