K
Ken Little
I am trying to write some code for a Function called AlScore. However, I
get the error message:
"Compile Error: Argument Not Optional"
and the last IIF is highlighted in Blue.
Public Function AlScore(PctScore)
AlScore = IIf(PctScore < 0.5, 11, IIf(PctScore >= 0.5 _
And PctScore <= 0.54999, 10, IIf(PctScore >= 0.55 _
And PctScore <= 0.59999, 9, IIf(PctScore >= 0.6 _
And PctScore <= 0.64999, 8, IIf(PctScore >= 0.65 _
And PctScore <= 0.69999, 7, IIf(PctScore >= 0.7 _
And PctScore <= 0.74999, 6, IIf(PctScore >= 0.75 _
And PctScore <= 0.79999, 5, IIf(PctScore >= 0.8 _
And PctScore <= 0.84999, 4, IIf(PctScore >= 0.85 _
And PctScore <= 0.89999, 3, IIf(PctScore >= 0.9 _
And PctScore <= 0.94999, 2, IIf(PctScore >= 0.95 _
And PctScore <= 1, 1)))))))))))
End Function
Any ideas? - Ken
get the error message:
"Compile Error: Argument Not Optional"
and the last IIF is highlighted in Blue.
Public Function AlScore(PctScore)
AlScore = IIf(PctScore < 0.5, 11, IIf(PctScore >= 0.5 _
And PctScore <= 0.54999, 10, IIf(PctScore >= 0.55 _
And PctScore <= 0.59999, 9, IIf(PctScore >= 0.6 _
And PctScore <= 0.64999, 8, IIf(PctScore >= 0.65 _
And PctScore <= 0.69999, 7, IIf(PctScore >= 0.7 _
And PctScore <= 0.74999, 6, IIf(PctScore >= 0.75 _
And PctScore <= 0.79999, 5, IIf(PctScore >= 0.8 _
And PctScore <= 0.84999, 4, IIf(PctScore >= 0.85 _
And PctScore <= 0.89999, 3, IIf(PctScore >= 0.9 _
And PctScore <= 0.94999, 2, IIf(PctScore >= 0.95 _
And PctScore <= 1, 1)))))))))))
End Function
Any ideas? - Ken