Round Function has stopped working - Urgent

S

Stuart

The Round function no longer works. It fails with the
message:
Wrong number of arguments or invalid property
assignment.

With ng help, I was given this slightly amended code:
Sub TestRound2()
Dim ws As Worksheet, R As Range, C As Range
Dim qty As Double, rate As Double, Data As Double

With ActiveSheet
'.Unprotect
Set C = .Range("D2")
Data = C.Offset(0, 9).Value
qty = C.Value
rate = C.Offset(0, 2).Value
If Data > 0 Then
If Data = 5 Then
C.Offset(0, 4).Value = Round(qty * rate * Data / 100, 2)
ElseIf Data = 17.5 Then
C.Offset(0, 5).Value = Round((qty * rate * Data) / 100, 2)
End If
End If
End With
MsgBox Round(qty * rate * Data / 100, 2)
End Sub

This fails as well, if I paste it into a module in the same Project.

However, if placed in a different Project (or a newly created
Project), then all is well.

Another routine in that same Project is now giving the same
Round error message .

Is there anything to resolve this, please?

Regards.
 
T

Tom Ogilvy

You have probably declared round as a function somewhere in that project.
The local definition is taking precedence over the built in function.
 
J

JE McGimpsey

Look for a sub or function in your project named Round() and rename it.

A local sub will override a VBA method.
 
Top