Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why Am I getting 2 different outcomes
I have a mcaro. When I run it directly I get one answer and when I run it in
debug mode I get completely different answers. All of this happens only on one line of code: c.Value = Evaluate("=SUMPRODUCT((B" & AAVM_sRow & ":B" & AAVM_eRow & "<"""")/COUNTIF(B" & AAVM_sRow & ":B" & AAVM_eRow & ",B" & AAVM_sRow & ":B" & AAVM_eRow & " & """"))") In debug mode c.Value=5 In direct mode c.Value=13 I can't figure out why its doing that. Some of codes in the same file are behaving the same way and I can't figure out why they work fine in debug mode but when I run them directly, everything breaks down. Any help will be greatly appreciated. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why Am I getting 2 different outcomes
Without testing, try:
c.value = c.parent.evaluate(.....) It could be because you've activated the correct sheet in one of your tests. Evaluate (or application.evaluate) will use the activesheet--and that may not be what you want. But that's what Tushar Mehta explained in the other thread. And did you try all the suggestions? Ayo wrote: I have a mcaro. When I run it directly I get one answer and when I run it in debug mode I get completely different answers. All of this happens only on one line of code: c.Value = Evaluate("=SUMPRODUCT((B" & AAVM_sRow & ":B" & AAVM_eRow & "<"""")/COUNTIF(B" & AAVM_sRow & ":B" & AAVM_eRow & ",B" & AAVM_sRow & ":B" & AAVM_eRow & " & """"))") In debug mode c.Value=5 In direct mode c.Value=13 I can't figure out why its doing that. Some of codes in the same file are behaving the same way and I can't figure out why they work fine in debug mode but when I run them directly, everything breaks down. Any help will be greatly appreciated. Thanks -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
If function with 3 different outcomes | Excel Worksheet Functions | |||
IF formula with 3 possible outcomes | Excel Worksheet Functions | |||
#Value! Same formula, different outcomes | Excel Programming | |||
#N/A outcomes in formulas | Excel Discussion (Misc queries) | |||
256 possible outcomes | Excel Discussion (Misc queries) |