peraphs Hans just have post a solution for the prob in image, but i dont found...
in effect in debug print the 2 var are exactlly the same but th IF statement not WORK!!!!!!!!!!!!
note:
all var are dimensioned Double
SUMM with gHOST!!!!
-
- PlatinumLounger
- Posts: 4370
- Joined: 26 Apr 2010, 17:36
SUMM with gHOST!!!!
Last edited by sal21 on 08 Nov 2013, 10:36, edited 1 time in total.
-
- Administrator
- Posts: 78629
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: SUMM with gHOST!!!!
What happens if you use
Debug.Print DIFFERENZA - SALDO
Do you get 0?
Debug.Print DIFFERENZA - SALDO
Do you get 0?
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4370
- Joined: 26 Apr 2010, 17:36
Re: SUMM with gHOST!!!!
HansV wrote:What happens if you use
Debug.Print DIFFERENZA - SALDO
Do you get 0?
-3,63797880709171E-12 (??????????????????)
-
- Administrator
- Posts: 78629
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: SUMM with gHOST!!!!
That means that DIFFERENZA and SALDO are almost equal but not quite: there is a difference of 0.0000000000036...
Change the line
If DIFFERENZA <> SALDO Then
to
If Abs(DIFFERENZA - SALDO) > 0.0001 Then
The code will then ignore very small differences between DIFFERENZA and SALDO.
Change the line
If DIFFERENZA <> SALDO Then
to
If Abs(DIFFERENZA - SALDO) > 0.0001 Then
The code will then ignore very small differences between DIFFERENZA and SALDO.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4370
- Joined: 26 Apr 2010, 17:36
Re: SUMM with gHOST!!!!
work tkx!HansV wrote:That means that DIFFERENZA and SALDO are almost equal but not quite: there is a difference of 0.0000000000036...
Change the line
If DIFFERENZA <> SALDO Then
to
If Abs(DIFFERENZA - SALDO) > 0.0001 Then
The code will then ignore very small differences between DIFFERENZA and SALDO.