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.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.601 / Virus Database: 382 - Release Date: 29/02/2004