Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
If function with 3 different outcomes Max Excel Worksheet Functions 5 April 3rd 23 03:41 PM
IF formula with 3 possible outcomes Aaron Hodson \(Coversure\) Excel Worksheet Functions 8 November 8th 07 04:52 PM
#Value! Same formula, different outcomes Texas Aggie Excel Programming 5 October 31st 07 03:32 PM
#N/A outcomes in formulas Caroline Excel Discussion (Misc queries) 2 August 29th 07 03:33 PM
256 possible outcomes MarkN Excel Discussion (Misc queries) 9 June 28th 06 08:33 AM


All times are GMT +1. The time now is 09:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"