|
-
Mar 7th, 2019, 05:54 PM
#2
Re: Weird Math Error in VBA for Excel
You mention an error, but I'm assuming you mean unexpected results rather than an error message.
Based on your textual description of the intended order of events, and your example formulas that you report are working properly, the error appears to be an order of operations error in your vba code. In your code, "SQRD Mod 400" takes place before "/ decx".
So, this should do things in the order you describe.
Code:
For Count = 1 To looptime
SQRD = CDec(SQRD ^ 2) '+ looptime
SQRD = CDec(SQRD / decx) Mod 400
Next Count
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|