Help on if function

D

DeViL_LaW

can any1 tell me the formula to run a macro from an if statement?
eg =if(a1>a2,macro...,macro...)
 
D

Don Guillett

try
right click on the sheet tab>view code>insert this>SAVE

Private Sub Worksheet_Calculate()
If Range("a1") > Range("a2") Then
Macro1
Else
Macro2
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top