Hi. Just new to this site. It looks very informative. I have a question. Is it possible to have an IF formula qualify certain criteria and then command a macro?
Yes.
Try this:
in cell F13 your IF formula, say:
=IF(E13=D13,TRUE,"")
Right-click that sheet's tab and paste these two macros:
Code:
Private Sub Worksheet_Calculate()
If Range("F13") = True Then blah
End Sub
Sub blah()
MsgBox "Hello!"
End Sub
Now change E13 and D13 on the sheet to the same.
You could do this another way, a bit shorter by eliminating the IF formula in cell F13 and deleting the Sheet_Calculate event handler (macro), replacing it with the sheet_change event handler:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("D13") = Range("E13") Then blah
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.