I have a VB if statement that compares a report total (Range("ShareTotal")) to a running total (ReportTotal) – each total goes out 4 decimal places. They both match (1,703,874,448.7524) but the if statement is performing the “else” condition – as if they don’t match. My only guess is it has to do with going out 4 decimals. I tried a number of different data types and they all act like the two don’t match. . Any insight?
If Range("ShareTotal") = ReportTotal Then
MsgBox "Omni Shares ** Matches ** EARS Extract" & Chr(13) & Chr(13) & " " & Format(ReportTotal, "#,##0.0000; (#,##0.0000)"), vbInformation, "Share Reconciliation Report"
Else
MsgBox "Omni Shares ** Does Not Match ** EARS Extract" & Chr(13) & Chr(13) & " Difference: " & Format(ReportTotal - Range("ShareTotal").Value, "#,##0.0000; (#,##0.0000)"), vbCritical, "Share Reconciliation Report"
End If