View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_4_] Jim Thomlinson[_4_] is offline
external usenet poster
 
Posts: 1,119
Default Change in cell from formula to auto run a macro

Private Sub Worksheet_Change(ByVal Target As Range)
if not intersect(target, range("H12:H1000")) is nothing
if range("F2").value = 0 then
Call Macro2
else
Call Macro1
endif
end if
end sub

--
HTH...

Jim Thomlinson


"Alex Martins" wrote:

Hi, I have been struggling with a problem for some time now, and I can't fin
my way around it.

I have a cell f2 that has a formula, and I want Macro1 to run automatically
when that value is different than 0, or Macro2 to run if that value is = 0.
The thing is it detects manual changes (like tyoing the number myself), but
it does nothing when the value changes using the formula.

Any ideas, suggestions, etc.?

Many thanks in advance.
Alex