It looks like that would work if you placed
"Application.WorksheetFunction." in front of the SUM statement.
> I have a workbook in which users dump in data, run a macro and use the
> result. The macro itself works great, but the users need to go the original
[quoted text clipped - 21 lines]
>
> PJ
PJFry - 29 Aug 2007 18:56 GMT
That did it. I also had to add a rounding function to x and y. It was
showing a variance of something like 5.31654-11.
x As Double
y As Double
Here is what I ended up with:
x = Application.WorksheetFunction.Sum(Sheets("Data").Range("AI:AI"))
y = Application.WorksheetFunction.Sum(Sheets("Upload").Range("C:C"))
If Round(x, 2) <> Round(y, 2) Then
MsgBox "Totals between the Data tab and the Upload tab do not match.",
vbOKOnly, "Total Error"
MsgBox "The file creation has been halted. Please correct the error and
rerun.", vbOKOnly
Exit Sub
End If
> It looks like that would work if you placed
> "Application.WorksheetFunction." in front of the SUM statement.
[quoted text clipped - 24 lines]
> >
> > PJ