View Single Post
  #5   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

What are the formulas in H12 through H1000. We need to capture changes to the
precidents of these formulas. If there is no easy way to track all of the
cells which can effect the values of H12-1000 then we will have to come at
this from a new direction...
--
HTH...

Jim Thomlinson


"Alex Martins" wrote:

Hey Jim,. Thanks for answering again!

Here's what I got.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Worksheets("NEW FILINGS").Range("h12:h1000")) Is
Nothing Then
If Worksheets("NEW FILINGS").Range("h12:h1000").Value = 0 Then
Call GetReported
Else
Call GetReports
End If
End If
End Sub

The problem is that (h12-h1000) are formulas as well...is this disrupting
the propoer function of this code?

Thanks in advance,
Alex

"Jim Thomlinson" wrote:

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